### Question:
RandomPortFinder { public static int findAvailablePort() { for (int i=0; i<1000; i++) { try { int port = getRandomPort(); if(!isRunning(executeGrepProcessCommand(port))){ return port; } } catch (IOException ex) { } } String message = "Not Found Available port: 10000 ~ 65535"; log.error(message); throw new SqsMockException(message); }  static int findAvailablePort(); static int getRandomPort();  }### Answer:
@Test public void get_available_port() throws Exception { int usePort = 10000; ServerSocket serverSocket = new ServerSocket(usePort); int availablePort = RandomPortFinder.findAvailablePort(); assertTrue(availablePort != usePort); serverSocket.close(); }