T takeNextConnection() throws InterruptedException {
  while (true) {
    T next=getNextConnection();
    if (next != null) {
      return next;
    }
  }
}

T takeNextConnection ( ) throws InterruptedException { while ( true ) { T next = getNextConnection ( ) ; if ( next != null ) { return next ; } } }
returns the next connection or blocks until next connection is available .
