public Connection useFirst(Predicate<Connection> predicate) {
    final EqualsWithPredicate equalsWithPredicate = new EqualsWithPredicate(predicate);
    while (connections.removeFirstOccurrence(equalsWithPredicate)) {
      Connection connection = equalsWithPredicate.getConnectionThatMatched();
      if (connection.activate()) {
        // Need to recheck the predicate after we have activated.
        // Until activated load conditioning can change the server
        // we are connected to.
        if (predicate.test(connection)) {
          return connection;
        } else {
          addLast(connection, false);
        }
      }
    }
    return null;
  }
Remove, activate, and return the first connection that matches the predicate.
Connections that can not be activated will be removed from the manager but not returned.

@param predicate that the connections are matched against
@return the activated connection or null if none found
geode-core/src/main/java/org/apache/geode/cache/client/internal/pooling/AvailableConnectionManager.java