@Override
  public boolean isBetterFilter(Filter comparedTo, ExecutionContext context, final int thisSize)
      throws FunctionDomainException, TypeMismatchException, NameResolutionException,
      QueryInvocationTargetException {
    // If the current filter is equality & comparedTo filter is also equality based , then
    // return the one with lower size estimate is better
    boolean isThisBetter = true;

    // Go with the lowest cost when hint is used.
    if (context instanceof QueryExecutionContext && ((QueryExecutionContext) context).hasHints()) {
      return thisSize <= comparedTo.getSizeEstimate(context);
    }

    int thatOperator = comparedTo.getOperator();
    switch (thatOperator) {
      case TOK_EQ:
        isThisBetter = false;
        break;
      case TOK_NE:
      case TOK_NE_ALT:
        // Give preference to Range
        break;
      case LITERAL_and:
        // Asif: What to do? Let current be the better one for the want of better estimation
        break;
      case TOK_LE:
      case TOK_LT:
      case TOK_GE:
      case TOK_GT:
        // Give preference to this rather than single condition inequalities as a rangejunction
        // would possibly be bounded resulting in lesser values
        break;
      default:
        throw new IllegalArgumentException("The operator type =" + thatOperator + " is unknown");
    }

    return isThisBetter;
  }
This structure contains all the filter evaluatable CompiledComparision conditions which are using
identical index. Presently this Object will be formed only if the junction is an AND and will
either be a part of a GroupJunction or can be a stand alone Junction. In case it is a stand alone
Junction, then it can possibly have a not null Iter Operand, so that it can be evaluated along
with the expansion/truncation of index result.
geode-core/src/main/java/org/apache/geode/cache/query/internal/RangeJunction.java