@Test
public void getClientAddressWithHttpXForwardedFor() {

    Mockito.when(request.getHeader(Mockito.eq("HTTP_X_FORWARDED_FOR"))).thenReturn("192.168.1.1");
    Assert.assertEquals("192.168.1.1", ApiServlet.getClientAddress(request));
}