### Question:
NetUtils { public static InetAddress getLocalInetAddress(String host) throws SocketException { if (host == null) { return null; } InetAddress addr = null; try { addr = InetAddress.getByName(host); if (NetworkInterface.getByInetAddress(addr) == null) { addr = null; } } catch (UnknownHostException ignore) { } return addr; }  static SocketFactory getSocketFactory(Configuration conf,
      Class<?> clazz); static SocketFactory getDefaultSocketFactory(Configuration conf); static SocketFactory getSocketFactoryFromProperty(
      Configuration conf, String propValue); static InetSocketAddress createSocketAddr(String target); static InetSocketAddress createSocketAddr(String target,
                                                   int defaultPort); static void addStaticResolution(String host, String resolvedName); static String getStaticResolution(String host); static List <String[]> getAllStaticResolutions(); static InetSocketAddress getConnectAddress(Server server); static InputStream getInputStream(Socket socket); static InputStream getInputStream(Socket socket, long timeout); static OutputStream getOutputStream(Socket socket); static OutputStream getOutputStream(Socket socket, long timeout); static void connect(Socket socket, 
                             SocketAddress endpoint, 
                             int timeout); static String normalizeHostName(String name); static List<String> normalizeHostNames(Collection<String> names); static void verifyHostnames(String[] names); static String getHostNameOfIP(String ip); static String getHostname(); static InetAddress getLocalInetAddress(String host);  }### Answer:
@Test public void testGetLocalInetAddress() throws Exception { assertNotNull(NetUtils.getLocalInetAddress("127.0.0.1")); assertNull(NetUtils.getLocalInetAddress("invalid-address-for-test")); assertNull(NetUtils.getLocalInetAddress(null)); }