@Test
public void testGetLocalHostName() {

    try {
        final InetAddress localHostAddress = InetAddress.getLocalHost(); // Could throw exception
        final String localHostName = networkUtils.getLocalHostName();
        assertNotNull("Name of localhost should not be null", localHostName);
        final InetAddress addressByName = InetAddress.getByName(localHostName);
        assertEquals("The addresses should be equal", localHostAddress, addressByName);
    }
    catch (final UnknownHostException e) {
        System.err.println("Could not get localhost - aborting test: " + e.toString());
    }
}