private boolean areEqualsInner(BinaryNode tree1, BinaryNode tree2) {
    if (tree1 == null && tree2 != null || tree1 != null && tree2 == null) {
      return false;
    } else if (tree1 == null && tree2 == null) {
      return true;
    } else {
      return tree1.equals(tree2)
          && areEqualsInner(tree1.getLeft(), tree2.getLeft())
          && areEqualsInner(tree1.getRight(), tree2.getRight());
    }
  }
Recursive implementation for this algorithm. Complexity order in time terms equals to O(N)
where N is the number of nodes in the smaller tree. In space terms, the complexity order of
this algorithm is O(1) because we are not using any additional data structure to keep nodes
information.

Related with the execution time of this algorithm is really important take into account the
third recursion case where we are going to use "if" short circuit to avoid go through the
whole
tree and stop comparing nodes once we find one different.
src/main/java/com/github/pedrovgs/problem17/BinaryTreeEquals.java