@Test
  public void testHashIndexAndEquiJoinForSingleResultQueryWithCompactRangeIndexLessEntries()
      throws Exception {
    createReplicatedRegion("portfolios");
    createData(region, 400);
    createJoinTable(200);
    Index index = qs.createIndex("index2", "p2.ID", SEPARATOR + "portfolios2 p2");
    helpTestHashIndexForQuery(
        "Select * FROM " + SEPARATOR + "portfolios p, " + SEPARATOR
            + "portfolios2 p2 where (p.ID = 1 or p.ID = 2 )and p.ID = p2.ID");
  }
Tests that hash index is used and that it returns the correct result
geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/HashIndexQueryIntegrationTest.java