@Test
public void testResolveToHostNameShouldReturnHostName() throws UnknownHostException {

    //GIVEN
    String expectedHostName = "expectedHostName";
    given(inetAddressFactory.createByName("anIPAddress")).willReturn(inetAddress);
    given(inetAddress.getHostName()).willReturn(expectedHostName);
    //WHEN
    String actualHostName = underTest.resolveToHostName("anIPAddress");
    //THEN
    assertEquals(expectedHostName, actualHostName);
}