@@ -0,0 +1,865 @@
+package org.threadly.litesockets.utils;%0A%0Aimport java.io.IOException;%0Aimport java.net.InetSocketAddress;%0Aimport java.net.ServerSocket;%0Aimport java.nio.channels.DatagramChannel;%0A%0Apublic class TestUtils %7B%0A%0A  public static int findTCPPort() %7B%0A    try %7B%0A      ServerSocket s = new ServerSocket(0);%0A      int port = s.getLocalPort();%0A      s.close();%0A      return port;%0A    %7D catch(IOException e) %7B%0A      //We Dont Care%0A    %7D%0A    throw new RuntimeException(%22Could not find a port!!%22);%0A  %7D%0A  %0A  public static int findUDPPort() %7B%0A    try %7B%0A      DatagramChannel channel = DatagramChannel.open();%0A      channel.socket().bind(new InetSocketAddress(%22127.0.0.1%22, 0));%0A      int port = channel.socket().getLocalPort();%0A      channel.close();%0A      return port;%0A    %7D catch(IOException e) %7B%0A      //We Dont Care%0A    %7D%0A  throw new RuntimeException(%22Could not find a port!!%22);%0A%7D%0A%7D%0A

add some helper functions