@Test
public void getAvailablePort() throws Exception {

    int port = NetUtils.getAvailablePort("127.0.0.1", 33000);
    Assert.assertTrue(port >= 33000 && port < 65535);
    port = NetUtils.getAvailablePort("0.0.0.0", 33000);
    Assert.assertTrue(port >= 33000 && port < 65535);
    port = NetUtils.getAvailablePort(SystemInfo.getLocalHost(), 33000);
    Assert.assertTrue(port >= 33000 && port < 65535);
    port = NetUtils.getAvailablePort("127.0.0.1", -1);
    Assert.assertTrue(port >= 0 && port < 65535);
}