private void likePercentageTerminated_3(boolean useBindPrm) throws Exception {
    Cache cache = CacheUtils.getCache();
    AttributesFactory attributesFactory = new AttributesFactory();
    RegionAttributes regionAttributes = attributesFactory.create();

    Region region = cache.createRegion("pos", regionAttributes);

    char ch = 'd';
    String base = "abc";
    for (int i = 1; i < 6; ++i) {
      Portfolio pf = new Portfolio(i);
      pf.status = base + ch;
      ch += 1;
      region.put(i, pf);
    }

    base = "abd";
    ch = 'd';
    for (int i = 6; i < 11; ++i) {
      Portfolio pf = new Portfolio(i);
      pf.status = base + ch;
      ch += 1;
      region.put(i, pf);
    }

    QueryService qs = cache.getQueryService();

    String predicate = "";
    if (useBindPrm) {
      predicate = "$1";
    } else {
      predicate = " 'abc%'";
    }
    Query q = qs.newQuery(
        "SELECT distinct *  FROM " + SEPARATOR + "pos ps WHERE ps.status like " + predicate
            + " OR ps.ID > 6");
    SelectResults results;
    if (useBindPrm) {
      results = (SelectResults) q.execute(new Object[] {"abc%"});
    } else {
      results = (SelectResults) q.execute();
    }
    ResultsBag bag = new ResultsBag(null);
    for (int i = 1; i < 11; ++i) {
      if (i != 6) {
        bag.add(region.get(i));
      }
    }
    SelectResults expectedResults =
        new ResultsCollectionWrapper(new ObjectTypeImpl(Object.class), bag.asSet());
    SelectResults[][] rs = new SelectResults[][] {{results, expectedResults}};
    CacheUtils.compareResultsOfWithAndWithoutIndex(rs, this);

    // Create Index
    qs.createIndex("status", IndexType.FUNCTIONAL, "ps.status", SEPARATOR + "pos ps");

    QueryObserver old = QueryObserverHolder.setInstance(new QueryObserverAdapter() {
      private boolean indexCalled = false;

      @Override
      public void afterIndexLookup(Collection results) {
        indexCalled = true;
      }

      @Override
      public void endQuery() {
        assertFalse(indexCalled);
      }

    });
    if (useBindPrm) {
      results = (SelectResults) q.execute(new Object[] {"abc%"});
    } else {
      results = (SelectResults) q.execute();
    }

    rs[0][0] = results;
    rs[0][1] = expectedResults;
    CacheUtils.compareResultsOfWithAndWithoutIndex(rs, this);
    qs.createIndex("id", IndexType.FUNCTIONAL, "ps.ID", SEPARATOR + "pos ps");
    QueryObserverHolder.setInstance(new QueryObserverAdapter() {
      private final boolean[] indexCalled = new boolean[] {false, false};

      private int i = 0;

      @Override
      public void afterIndexLookup(Collection results) {
        indexCalled[i++] = true;
      }

      @Override
      public void endQuery() {
        for (final boolean b : indexCalled) {
          assertTrue(b);
        }
      }

    });

    if (useBindPrm) {
      results = (SelectResults) q.execute(new Object[] {"abc%"});
    } else {
      results = (SelectResults) q.execute();
    }

    rs[0][0] = results;
    rs[0][1] = expectedResults;
    CacheUtils.compareResultsOfWithAndWithoutIndex(rs, this);
    QueryObserverHolder.setInstance(old);
  }
Tests a simple % terminated like predicate with an OR condition
geode-core/src/integrationTest/java/org/apache/geode/cache/query/functional/LikePredicateJUnitTest.java