private static String getRemoteIp(final HttpServletRequest request) {
        String xForwardedFor = request.getHeader(X_FORWARDED_FOR);
        if (!StringUtils.isBlank(xForwardedFor)) {
            return xForwardedFor.split(X_FORWARDED_FOR_SPLIT_SYMBOL)[0].trim();
        }
        String header = request.getHeader(X_REAL_IP);
        return StringUtils.isBlank(header) ? request.getRemoteAddr() : header;
    }
@Test
    public void testGetRemoteIp() {
        this.httpServletRequest.addHeader(X_FORWARDED_FOR, "x-forwarded-for,test");
        this.httpServletRequest.addHeader(X_REAL_IP, "127.0.0.1");
        String xForwardedFor = httpServletRequest.getHeader(X_FORWARDED_FOR);
        assertNotNull(xForwardedFor);
        assertTrue(StringUtils.isNotBlank(xForwardedFor));
        assertEquals("x-forwarded-for,test", xForwardedFor);
        assertEquals("127.0.0.1", httpServletRequest.getHeader(X_REAL_IP));
    }