code: boolean findSimilarities(MathNode refTree, MathNode comTree, List<Match> similarities, boolean holdRefTree, boolean onlyOperators) {
          if (isIdenticalTree(refTree, comTree)) {
              // hit!
              comTree.setMarked();
              similarities.add(new Match(refTree, comTree, type));
              return true;
          }
          // iterate the comparison tree over the current node from the ref tree
          for (MathNode compChild : comTree.getChildren()) {
              // don't look at leafs if it is already marked
              // or we only want to compare branching nodes
              if (compChild.isMarked() || onlyOperators && compChild.isLeaf()) {
                  continue;
              }
              // go deeper in the comp. tree but hold the ref tree
              if (findSimilarities(refTree, compChild, similarities, true, onlyOperators)) {
                  return true;
              }
          }
  
          if (!holdRefTree) {
              // go deeper in the reference tree
              for (MathNode refChild : refTree.getChildren()) {
                  if (onlyOperators && refChild.isLeaf()) {
                      continue;
                  }
                  findSimilarities(refChild, comTree, similarities, false, onlyOperators);
              }
          }
          return false;
      }
docs: Recursive method that goes along every node of the reference tree and tries to find
  identical subtree with the comparison tree.
  
  @param refTree       Reference MathNode tree
  @param comTree       Comparison MathNode tree
  @param similarities  List of similarities, will be filled during process.
  @param holdRefTree   Hold the reference tree in position and only iterate over the comparison tree
  @param onlyOperators Find similarities only between operations, no single identifier (end leafs) are checked
  @return true - if the current aTree ad bTree are identical subtrees, false otherwise