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

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

    String[] values = new String[] {"active",};

    for (int i = 0; i < values.length; i++) {
      region.put(i, values[i]);
    }

    QueryService qs = cache.getQueryService();
    Query q;
    SelectResults results;

    String[] likePredicates = new String[] {"active", "act%%ve", "a%e", "%ctiv%", "%c%iv%",
        "%ctive", "%%ti%", "activ_", "_ctive", "ac_ive", "_c_iv_", "_ctiv%", "__tive", "act__e",
        "a%iv_", "a_tiv%", "%", "ac%",};
    for (final String predicate : likePredicates) {
      if (!useBindPrms) {
        q = qs.newQuery(
            "select p from " + SEPARATOR + "pos.values p where p like '" + predicate + "'");
        results = (SelectResults) q.execute();
      } else {
        q = qs.newQuery("select p from " + SEPARATOR + "pos.values p where p like $1");
        results = (SelectResults) q.execute(new Object[] {predicate});
      }
      List r = results.asList();
      if (r.size() != 1 || !r.get(0).equals(values[0])) {
        fail("Unexpected result. expected :" + values[0] + " for the like predicate: "
            + predicate + " found : "
            + (r.size() == 1 ? r.get(0) : "Result size not equal to 1"));
      }
    }

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

    for (final String likePredicate : likePredicates) {
      if (!useBindPrms) {
        q = qs.newQuery(
            "select p from " + SEPARATOR + "pos.values p where p like '" + likePredicate + "'");
        results = (SelectResults) q.execute();
      } else {
        q = qs.newQuery("select p from " + SEPARATOR + "pos.values p where p like $1");
        results = (SelectResults) q.execute(new Object[] {likePredicate});
      }
      List r = results.asList();
      if (r.size() != 1 || !r.get(0).equals(values[0])) {
        fail("Unexpected result. expected :" + values[0] + " for the like predicate: "
            + likePredicate + " found : "
            + (r.size() == 1 ? r.get(0) : "Result size not equal to 1"));
      }
    }
  }
Tests with combination of % and _ Supported from 6.6
geode-core/src/integrationTest/java/org/apache/geode/cache/query/functional/LikePredicateJUnitTest.java