<commit_before>package see.tree.immutable;

import com.google.common.base.Objects;
import see.tree.ConstNode;
import see.tree.Visitor;

public final class ImmutableConstNode<T> implements ConstNode<T> {
	private final T value;

	public ImmutableConstNode(T value) {
		this.value = value;
	}

	@Override
    public T accept(Visitor visitor) {
		return visitor.visit(this);
	}

    @Override
    public <V> V accept(ValueVisitor<V> visitor) {
        return visitor.visit(this);
    }

    @Override public T getValue() {
		return value;
	}

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ImmutableConstNode that = (ImmutableConstNode) o;

        return Objects.equal(value, that.value);

    }
<commit_msg>Added factory method to immutable const node<commit_after>package see.tree.immutable;

import com.google.common.base.Objects;
import see.tree.ConstNode;
import see.tree.Visitor;

public final class ImmutableConstNode<T> implements ConstNode<T> {
	private final T value;

	public ImmutableConstNode(T value) {
		this.value = value;
	}

    public static <V> ConstNode<V> constNode(V value) {
        return new ImmutableConstNode<V>(value);
    }

	@Override
    public T accept(Visitor visitor) {
		return visitor.visit(this);
	}

    @Override
    public <V> V accept(ValueVisitor<V> visitor) {
        return visitor.visit(this);
    }

    @Override public T getValue() {
		return value;
	}

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ImmutableConstNode that = (ImmutableConstNode) o;

        return Objects.equal(value, that.value);

    }

{'fraction_non_alphanumeric': 0.11011738401341531, 'fraction_numerical': 0.0, 'mean_word_length': 3.211764705882353, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '824514', 'n_tokens_mistral': 566, 'n_tokens_neox': 544, 'n_words': 151}