NetworkUtils { @Nullable public NetworkInterface getNetworkInterfaceByName(final String name) { if (name == null) { return null; } try { return NetworkInterface.getByName(name); } catch (final SocketException e) { LOG.log(Level.WARNING, e.toString()); return null; } }  boolean isUsable(@Nullable final NetworkInterface netif); boolean hasIPv4Address(@Nullable final NetworkInterface netif); String getNetworkInterfaceInfo(@Nullable final NetworkInterface netif); String getIPv4Addresses(@Nullable final NetworkInterface netif); String getIPv4Addresses(@Nullable final NetworkInterfaceInfo networkInterfaceInfo); String getMacAddress(@Nullable final NetworkInterface netif); @Nullable NetworkInterface getUpdatedNetworkInterface(@Nullable final NetworkInterface origNetIf); boolean sameNetworkInterface(@Nullable final NetworkInterface netIf1,
                                        @Nullable final NetworkInterface netIf2); @Nullable NetworkInterface findFirstUsableNetworkInterface(); @Nullable Enumeration<NetworkInterface> getNetworkInterfaces(); List<NetworkInterfaceInfo> getUsableNetworkInterfaces(); @Nullable String getLocalHostName(); @Nullable NetworkInterface getNetworkInterfaceByName(final String name); static final int IPTOS_RELIABILITY; }
@Test @Ignore("Machine specific test") public void getNetworkInterfaceByName() { final NetworkInterface eth0 = networkUtils.getNetworkInterfaceByName("eth0"); System.out.println(networkUtils.getNetworkInterfaceInfo(eth0)); }