private static ServerSocket random() throws IOException {
  final ServerSocket skt=new ServerSocket(0);
  skt.setReuseAddress(true);
  return skt;
}

private static ServerSocket random ( ) throws IOException { final ServerSocket skt = new ServerSocket ( 0 ) ; skt . setReuseAddress ( true ) ; return skt ; }
make a random socket .
