ServerUtil { public static boolean isSocketPort(int serverPort) { return serverPort > 0x400 && serverPort <= 0xFFFF; }  static boolean isIpv4(String ip); static int getNewPort(); @SneakyThrows static int getNewPort(String key); static boolean isPort(int serverPort); static boolean isSocketPort(int serverPort); static boolean checkHostAndPort(String serverHost, int serverPort); static String buildCacheKey(String serverHost, int serverPort);  }
@Test public void testIsSocketPort() { assertTrue(ServerUtil.isSocketPort(8080)); assertFalse(ServerUtil.isSocketPort(80)); assertFalse(ServerUtil.isSocketPort(-1)); assertFalse(ServerUtil.isSocketPort(65536)); }