### Question:
SocketPool { Socket get() throws IOException { Socket socket; int port; synchronized (unused) { while (unused.isEmpty()) { try { logger.debug("Waiting for socket"); unused.wait(); } catch (InterruptedException e) { System.out.println("Interrupted!"); } } port = ((Integer) unused.remove(0)).intValue(); socket = createSocket(port); } logger.debug("Get: " + port); return socket; } SocketPool(final int size); Socket get(final String host, final int port); void release(final Socket socket);  }### Answer:
@Test public void testGet() throws IOException { assertTrue(pool.get().getLocalPort() == 13300); pool.returnToPool(13300); assertTrue(pool.get().getLocalPort() == 13301); pool.returnToPool(13301); assertTrue(pool.get().getLocalPort() == 13300); pool.returnToPool(13300); assertTrue(pool.get().getLocalPort() == 13301); pool.returnToPool(13301); }