public static synchronized String getLocalhost() {
        if (preferredHostName == null) {
            preferredHostName = getPreferredHostName();
        }
        return preferredHostName;
    }
@Test
    void testHostnameIsFound() {
        assertFalse(HostName.getLocalhost().isEmpty());
    }