code: @Override
      public ImmutableSet<Variable> getVariables(QueryNode node) {
          if (node instanceof ExplicitVariableProjectionNode) {
              return ((ExplicitVariableProjectionNode) node).getVariables();
          }
          else {
              return getProjectedVariableStream(node)
                      .collect(ImmutableCollectors.toSet());
          }
      }
docs: TODO: optimize by it but materializing (and maintaining) the results.