@Override
    public Connection createClientToServerConnection(final ServerLocation location,
        boolean forQueue) {
      creates.incrementAndGet();
      DistributedMember member = new InternalDistributedMember("localhost", 555);
      return new Connection() {

        private final Endpoint endpoint = endpointManager.referenceEndpoint(location, member);

        @Override
        public void destroy() {
          destroys.incrementAndGet();
        }

        @Override
        public ServerLocation getServer() {
          return location;
        }

        @Override
        public ByteBuffer getCommBuffer() {
          return null;
        }

        @Override
        public Socket getSocket() {
          return null;
        }

        @Override
        public long getBirthDate() {
          return 0;
        }

        @Override
        public void setBirthDate(long ts) {
          // nothing
        }

        @Override
        public ConnectionStats getStats() {
          return null;
        }

        @Override
        public boolean isActive() {
          return false;
        }

        @Override
        public void close(boolean keepAlive) {
          closes.incrementAndGet();
        }

        @Override
        public Endpoint getEndpoint() {
          return endpoint;
        }

        @Override
        public ServerQueueStatus getQueueStatus() {
          return null;
        }

        @Override
        public Object execute(Op op) throws Exception {
          return op.attempt(this);
        }

        @Override
        public boolean isDestroyed() {
          return false;
        }

        @Override
        public void emergencyClose() {
          // nothing
        }

        @Override
        public short getWanSiteVersion() {
          return -1;
        }

        @Override
        public int getDistributedSystemId() {
          return -1;
        }

        @Override
        public void setWanSiteVersion(short wanSiteVersion) {
          // nothing
        }

        @Override
        public InputStream getInputStream() {
          return null;
        }

        @Override
        public OutputStream getOutputStream() {
          return null;
        }

        @Override
        public void setConnectionID(long id) {
          // nothing
        }

        @Override
        public long getConnectionID() {
          return 0;
        }
      };
    }
This tests that a deadlock between connection formation and connection pool closing has been
fixed. See GEODE-4615
geode-core/src/integrationTest/java/org/apache/geode/cache/client/internal/pooling/ConnectionManagerJUnitTest.java