@Override
      public void run2() throws CacheException {
        AttributesFactory factory = new AttributesFactory();
        factory.setScope(Scope.LOCAL);
        final Region region1 = createRegion(name, factory.createRegionAttributes());
        final Region region2 = createRegion(name + "_2", factory.createRegionAttributes());
        QueryObserverHolder.setInstance(new QueryObserverAdapter() {
          @Override
          public void afterQueryEvaluation(Object result) {
            // Destroy the region in the test
            region1.close();
          }

        });
        for (int i = 0; i < numberOfEntries; i++) {
          region1.put("key-" + i, new TestObject(i, "ibm"));
          region2.put("key-" + i, new TestObject(i, "ibm"));
        }

      }
This the dunit test for the bug no : 36969
geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/RemoteQueryDUnitTest.java