Sockets { public static boolean isClosed( InetAddress inetAddress, int port ) { return ! isOpen( inetAddress, port ); }  static void waitForClosedPort( InetAddress inetAddress, int port); static void waitForClosedPort( InetAddress inetAddress, int port, long timeout ); static boolean isOpen( InetAddress inetAddress, int port); static boolean isClosed( InetAddress inetAddress, int port ); static void waitForOpenPort(String host, int port);  }
@Test @Ignore public void testClosedPort() throws Exception { InetAddress localHost = InetAddress.getLocalHost(); assertTrue(Sockets.isClosed(localHost, 9050) ); }