@Override
  public boolean isOrderByApplicableAtIndexLevel(ExecutionContext context,
      String canonicalizedOrderByClause) throws FunctionDomainException, TypeMismatchException,
      NameResolutionException, QueryInvocationTargetException {
    if (_operator == LITERAL_and) {
      // Set<IndexProtocol> usedIndex = new HashSet<>();
      boolean foundRightIndex = false;
      for (final CompiledValue operand : _operands) {
        PlanInfo pi = operand.getPlanInfo(context);
        if (pi.evalAsFilter && operand.getType() == JUNCTION) {
          return false;
        } else if (pi.evalAsFilter) {
          if (!foundRightIndex) {
            IndexProtocol ip =
                (IndexProtocol) operand.getPlanInfo(context).indexes.get(0);
            if (ip.getCanonicalizedIndexedExpression().equals(canonicalizedOrderByClause)
                && pi.isPreferred) {
              foundRightIndex = true;
            }
          }
          // usedIndex.addAll(this._operands[i].getPlanInfo(context).indexes);
        }
      }
      return foundRightIndex;
      // if(usedIndex.size() == 1 &&
      // usedIndex.iterator().next().getCanonicalizedIndexedExpression().equals(canonicalizedOrderByClause))
      // {
      // return true;
      // }
    }
    return false;
  }
Creates a GroupJunction or a RangeJunction based on the operands passed. The operands are
either Filter Operands belonging to single independent RuntimeIterator or are iter evaluable on
the RuntimeIterator[] passed as parameter. If all the filter evaluable operands use a single
Index , than a RangeJunction is created with iter operand as part of RangeJunction. If there
exists operands using multiple indexes, then a GroupJunction is created. In that case , the
operands using the same index are grouped in a RangeJunction & that Range Junction becomes part
of the GroupJunction. A GroupJunction may contain one or more RangeJunction

@param needsCompacting boolean indicating if there is a possibility of RangeJunction or not. If
       needsCompacting is false , then a GroupJunction will be formed, without any
       RangeJunction
@param grpIndpndntItr Array of RuntimeIterator which represents the independent iterator for
       the Group. for all cases , except a CompositeGroupJunction containing a single
       GroupJunction , will have a single RuntimeIterator in this array.
@param completeExpnsn boolean indicating whether the Group or Range Junction needs to be
       expanded to the query from clause level or the group level
@param cv Array of CompiledValue containing operands belonging to a group
@param sameIndexOperands Map object containing Index as the key & as a value an Integer object
       or a List. If it contains an Integer as value against Index, it implies that there is
       only one operand which uses that type of index & hence cannot form a RangeJunction. If
       it contains a List then the Lis contains the operands which use same index & thus can
       form a RangeJunction
@return Object of GroupJunction or RangeJunction as the case may be
geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledJunction.java