@@ -0,0 +1,1647 @@
+/*%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.facebook.presto.sql.tree;%0A%0Aimport static java.lang.String.format;%0Aimport static java.lang.System.identityHashCode;%0Aimport static java.util.Objects.requireNonNull;%0A%0Apublic final class NodeRef%3CT extends Node%3E%0A%7B%0A    public static %3CT extends Node%3E NodeRef%3CT%3E of(T node)%0A    %7B%0A        return new NodeRef%3C%3E(node);%0A    %7D%0A%0A    private final T node;%0A%0A    private NodeRef(T node)%0A    %7B%0A        this.node = requireNonNull(node, %22node is null%22);%0A    %7D%0A%0A    public T getNode()%0A    %7B%0A        return node;%0A    %7D%0A%0A    @Override%0A    public boolean equals(Object o)%0A    %7B%0A        if (this == o) %7B%0A            return true;%0A        %7D%0A        if (o == null %7C%7C getClass() != o.getClass()) %7B%0A            return false;%0A        %7D%0A        NodeRef%3C?%3E other = (NodeRef%3C?%3E) o;%0A        return node == other.node;%0A    %7D%0A%0A    @Override%0A    public int hashCode()%0A    %7B%0A        return identityHashCode(node);%0A    %7D%0A%0A    @Override%0A    public String toString()%0A    %7B%0A        return format(%0A                %22@%25s: %25s%22,%0A                Integer.toHexString(identityHashCode(node)),%0A                node);%0A    %7D%0A%7D%0A

Introduce NodeRef, a reference to Node