@Test
  public void testBug36421_part3() throws Exception {
    Query q = qs.newQuery("SELECT DISTINCT * FROM $1 z where z.status = 'active'");
    QueryObserverImpl observer = new QueryObserverImpl();
    QueryObserverHolder.setInstance(observer);
    q.execute(CacheUtils.getRegion(SEPARATOR + "pos"));
    if (!observer.isIndexesUsed) {
      fail("Index not uesd for operator '='");
    }
    assertTrue(observer.indexesUsed.get(0).equals("statusIndex"));
    region = CacheUtils.createRegion("pos1", Portfolio.class);
    region.put("0", new Portfolio(0));
    region.put("1", new Portfolio(1));
    region.put("2", new Portfolio(2));
    region.put("3", new Portfolio(3));
    qs.createIndex("statusIndex1", IndexType.FUNCTIONAL, "pf1.status", SEPARATOR + "pos1 pf1");
    region.put("4", new Portfolio(4));
    observer = new QueryObserverImpl();
    QueryObserverHolder.setInstance(observer);
    q.execute(CacheUtils.getRegion(SEPARATOR + "pos1"));
    if (!observer.isIndexesUsed) {
      fail("Index not used for operator'='");
    }
    assertTrue(observer.indexesUsed.get(0).equals("statusIndex1"));
  }
Test to check if a parametrized query when using different bind arguments of Region uses the
index correctly
geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/IndexUseJUnitTest.java