@Test
  public void testQueriesWithoutDistinct() throws Exception {
    populateOffsetPortfolioValuesInRegion("exampleRegion", 2);
    String[] queries = {"181"};
    int results = 0;
    for (Object result : utils.executeQueriesWithoutDistinct(queries)) {
      if (result instanceof SelectResults) {
        Collection<?> collection = ((SelectResults<?>) result).asList();
        results = collection.size();
        assertEquals(9, results);
        List expectedIds = new ArrayList(Arrays.asList(10, 9, 8, 7, 6, 5, 4, 3, 3));
        for (Object e : collection) {
          if (e instanceof Portfolio) {
            assertTrue(expectedIds.contains(((Portfolio) e).getID()));
            expectedIds.remove((Integer) ((Portfolio) e).getID());
          }
        }
      }
    }
  }
A sample test class using the QueryTestUtils
geode-core/src/integrationTest/java/org/apache/geode/cache/query/QueryTestUtilsJUnitTest.java