@Test
public void getAddresses() throws NamingException {

    JndiAddressProvider spy = Mockito.spy(jndiAdressProvider);
    Mockito.doReturn("127.0.0.1:11311").when(spy).lookup(jndiKey);
    List<InetSocketAddress> result = spy.getAddresses();
    assertNotNull(result);
    assertEquals(1, result.size());
    assertEquals("127.0.0.1", result.get(0).getAddress().getHostAddress());
    assertEquals(11311, result.get(0).getPort());
}