public Socket awaitConnection() throws InterruptedException {
    return awaitConnection(Long.MAX_VALUE);
  }
@Test
  public void testConnect() throws Exception {
    Thread thread = new Thread();
    thread.start();
    Socket socket = connector.awaitConnection(2 * DELAY);
    assertNotNull(socket);
    thread.join(DELAY);
    assertFalse(thread.isAlive());
    socket.close();
  }