@Override
  public ConnectedChannel checkOutConnection(String host, Port port, long timeout) {
    DataNodeId dataNodeId = clusterMap.getDataNodeId(host, port.getPort());
    MockHost hostObj = hosts.get(dataNodeId);
    if (!connections.containsKey(dataNodeId)) {
      connections.put(dataNodeId, new MockConnection(hostObj, maxEntriesToReturn));
    }
    return connections.get(dataNodeId);
  }
Implementation of {@link ConnectionPool} that hands out {@link MockConnection}s.
ambry-replication/src/test/java/com/github/ambry/replication/MockConnectionPool.java