@Override
    public void hook(int spot) throws RuntimeException {
      if (spot == 4) {
        synchronized (this) {
          if (done) {
            return;
          }
          done = true;
        }
        datastore1.invoke(JUnit4DistributedTestCase::disconnectFromDS);
        datastore2.invoke(JUnit4DistributedTestCase::disconnectFromDS);
      }
    }
Test hook that disconnects when invoked.
geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryDUnitTest.java