public PooledConnection acquire(Supplier<PooledConnection> supplier){
  PooledConnection poll=queue.poll();
  if (poll == null) {
    poll=supplier.get();
  }
  acquiredConnections.add(poll);
  if (isTerminating.get()) {
    acquiredConnections.remove(poll);
    poll.dispose();
    throw new IllegalStateException("Pool has been closed, cannot acquire new values.");
  }
  return poll;
}

public PooledConnection acquire ( Supplier < PooledConnection > supplier ) { PooledConnection poll = queue . poll ( ) ; if ( poll == null ) { poll = supplier . get ( ) ; } acquiredConnections . add ( poll ) ; if ( isTerminating . get ( ) ) { acquiredConnections . remove ( poll ) ; poll . dispose ( ) ; throw new IllegalStateException ( "Pool has been closed, cannot acquire new values." ) ; } return poll ; }
acquire connection or create a new one if the queue is empty
