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

        Node node = (Node) o;

        if (value != node.value) return false;
        if (left != null ? !left.equals(node.left) : node.left != null) return false;
        if (right != null ? !right.equals(node.right) : node.right != null) return false;

        return true;
    }