@Test
public void testSameNetworkInterface() {

    assertFalse(networkUtils.sameNetworkInterface(null, null));
    final Enumeration<NetworkInterface> networkInterfaces = networkUtils.getNetworkInterfaces();
    if (networkInterfaces != null) {
        try {
            final NetworkInterface interface1 = networkInterfaces.nextElement();
            final NetworkInterface interface2 = networkInterfaces.nextElement();
            assertTrue(networkUtils.sameNetworkInterface(interface1, interface1));
            assertTrue(networkUtils.sameNetworkInterface(interface2, interface2));
            assertFalse(networkUtils.sameNetworkInterface(interface1, interface2));
            assertFalse(networkUtils.sameNetworkInterface(interface1, null));
            assertFalse(networkUtils.sameNetworkInterface(null, interface2));
        }
        catch (final NoSuchElementException e) {
            System.err.println("Not enough network interfaces - aborting test");
        }
    }
    else {
        System.err.println("No network interfaces - aborting test");
    }
}