@Test
  public void test_borrow_connection_toward_specific_server_freeConnections() {
    long idleTimeoutMillis = 300;
    manager =
        new ConnectionManagerImpl("pool", factory, endpointManager, 5, 1, idleTimeoutMillis, -1,
            logger, 60 * 1000, cancelCriterion, poolStats);
    manager.start(background);

    await().untilAsserted(() -> assertThat(manager.getConnectionCount()).isOne());

    long borrowTimeoutMillis = 500;

    // seize connection toward any server
    manager.borrowConnection(borrowTimeoutMillis);
    manager.borrowConnection(borrowTimeoutMillis);

    assertThatCode(() -> {
      manager.borrowConnection(new ServerLocation("localhost", 5), borrowTimeoutMillis, false);
    }).doesNotThrowAnyException();
  }
Test borrow connection toward specific server. Max connection is 5, and there are free
connections in pool.
geode-core/src/integrationTest/java/org/apache/geode/cache/client/internal/pooling/ConnectionManagerJUnitTest.java