private int createClientCacheWithTwoRegions(final String host1, final int port1,
      final String host2, final int port2) {
    clientCache = (InternalClientCache) new ClientCacheFactory().create();
    assertThat(clientCache.isClient()).isTrue();

    PoolFactory poolFactory = createPoolFactory();
    poolFactory.addServer(host1, port1);
    poolFactory.addServer(host2, port2);

    Pool pool = poolFactory.create(getClass().getSimpleName() + "-Pool");

    createRegionOnClient(PROXY_REGION_NAME, ClientRegionShortcut.PROXY, pool);
    createRegionOnClient(CACHING_PROXY_REGION_NAME, ClientRegionShortcut.CACHING_PROXY, pool);

    return ((PoolImpl) pool).getPrimaryPort();
  }
Create client cache and return the client connection pool's primary server port
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/ClientWithInterestFailoverDistributedTest.java