code: @Override
      public NodeCentricOptimizationResults<InnerJoinNode> apply(InnerJoinOptimizationProposal proposal, IntermediateQuery query,
                                                                 QueryTreeComponent treeComponent)
              throws InvalidQueryOptimizationProposalException, EmptyQueryException {
  
          InnerJoinNode originalTopJoinNode = proposal.getFocusNode();
  
          ImmutableList<JoinOrFilterNode> filterOrJoinNodes = extractFilterAndInnerJoinNodes(originalTopJoinNode, query);
  
          QueryNode parentNode = query.getParent(originalTopJoinNode).get();
  
          Optional<ImmutableExpression> optionalAggregatedFilterCondition;
          try {
              optionalAggregatedFilterCondition = joinExtractionUtils.extractFoldAndOptimizeBooleanExpressions(filterOrJoinNodes);
          }
          /*
           * The filter condition cannot be satisfied --> the join node and its sub-tree is thus removed from the tree.
           * Returns no join node.
           */
          catch (UnsatisfiableExpressionException e) {
  
              EmptyNode replacingEmptyNode = iqFactory.createEmptyNode(query.getVariables(originalTopJoinNode));
              treeComponent.replaceSubTree(originalTopJoinNode, replacingEmptyNode);
  
              // Converts it into a NodeCentricOptimizationResults<InnerJoinNode>
              return new NodeCentricOptimizationResultsImpl<>(query, Optional.of(replacingEmptyNode));
          }
  
          /*
           * If something has changed
           */
          if ((filterOrJoinNodes.size() > 1)
                  || (!optionalAggregatedFilterCondition.equals(originalTopJoinNode.getOptionalFilterCondition()))) {
              /*
               * Optimized join node
               */
              InnerJoinNode newJoinNode = iqFactory.createInnerJoinNode(optionalAggregatedFilterCondition);
  
              Optional<ArgumentPosition> optionalPosition = treeComponent.getOptionalPosition(parentNode, originalTopJoinNode);
              treeComponent.replaceNodesByOneNode(ImmutableList.<QueryNode>copyOf(filterOrJoinNodes), newJoinNode, parentNode,
                      optionalPosition);
  
              return new NodeCentricOptimizationResultsImpl<>(query, newJoinNode);
          }
          else {
              return new NodeCentricOptimizationResultsImpl<>(query, originalTopJoinNode);
          }
      }
docs: Standard method (InternalProposalExecutor)