code: private Optional<CommutativeJoinOrFilterNode> getCandidateProvider(QueryNode subtreeRoot, IntermediateQuery query) {
  
          if (subtreeRoot instanceof ConstructionNode) {
              Optional<QueryNode> optChild = query.getFirstChild(subtreeRoot);
              return optChild.isPresent() ?
                      getCandidateProvider(optChild.get(), query) :
                      Optional.empty();
          }
          if (subtreeRoot instanceof CommutativeJoinOrFilterNode) {
              CommutativeJoinOrFilterNode castNode = (CommutativeJoinOrFilterNode) subtreeRoot;
              if (castNode.getOptionalFilterCondition().isPresent()) {
                  return Optional.of(castNode);
              }
          }
          return Optional.empty();
      }
docs: Recursive