@Override
      public void run2() throws CacheException {
        Region region = getRootRegion().getSubregion(name);
        String queryString = null;
        SelectResults results = null;

        queryString = "SELECT DISTINCT itr.value FROM " + region.getFullPath()
            + ".entries itr where itr.key = 'key-1'";
        try {
          results = region.query(queryString);
        } catch (Exception e) {
          Assert.fail("Failed executing " + queryString, e);
        }
        assertEquals(1, results.size());
        assertTrue(!results.getCollectionType().allowsDuplicates()
            && !results.getCollectionType().getElementType().isStructType());
        assertTrue(results.asList().get(0) instanceof TestObject);

        queryString = "SELECT DISTINCT itr.key FROM " + region.getFullPath()
            + ".entries itr where itr.key = 'key-1'";
        try {
          results = region.query(queryString);
        } catch (Exception e) {
          Assert.fail("Failed executing " + queryString, e);
        }
        assertEquals(1, results.size());
        assertTrue(!results.getCollectionType().allowsDuplicates()
            && !results.getCollectionType().getElementType().isStructType());
        assertEquals("key-1", results.asList().get(0));
      }
Tests remote query execution using a BridgeClient as the CacheWriter and CacheLoader.
geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/RemoteQueryDUnitTest.java