private void helpTestHashIndexOrderByAscQuery() throws Exception {
    index = qs.createHashIndex("idHash", "p.ID", SEPARATOR + "portfolios p");
    SelectResults results = (SelectResults) qs
        .newQuery("Select * FROM " + SEPARATOR + "portfolios p where p.ID != 0 order by ID asc ")
        .execute();
    assertEquals(199, results.size());
    assertTrue(observer.indexUsed);
    int countUp = 1;
    for (Object o : results) {
      Portfolio p = (Portfolio) o;
      assertEquals(countUp++, p.getID());
    }
  }
Test order by asc query for partitioned region using hash index
geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/HashIndexQueryIntegrationTest.java