code: protected PlanNode findOriginatingNode( PlanNode criteriaNode,
                                              List<PlanNode> originatingNodes ) {
          Set<SelectorName> requiredSelectors = criteriaNode.getSelectors();
          if (requiredSelectors.isEmpty()) return criteriaNode;
  
          // first look for originating nodes that exactly match the required selectors ...
          for (PlanNode originatingNode : originatingNodes) {
              if (!criteriaNode.isAbove(originatingNode)) continue;
              if (originatingNode.getSelectors().equals(requiredSelectors)) return originatingNode;
          }
  
          // Nothing matched exactly, so can we push down to a node that contain all of the required selectors ...
          for (PlanNode originatingNode : originatingNodes) {
              if (originatingNode.getSelectors().containsAll(requiredSelectors)) return originatingNode;
          }
          return null;
      }
docs: Find the first node that has all of the same {@link PlanNode#getSelectors() selectors} as the supplied criteria.
  
  @param criteriaNode the criteria
  @param originatingNodes the list of nodes to search
  @return the first (highest) node that is uses all of the same selectors as the criteria, or null if no such node could be
  found