public List<Tree<String>> getTrees() {
      List<Tree<String>> trees = new ArrayList<Tree<String>>();
      for (Backtrace backtrace : backtraces) {
        if (backtrace instanceof WordBacktrace) {
          WordBacktrace wordBacktrace = (WordBacktrace) backtrace;
          trees.add(new Tree<String>(getLabel(), Collections.singletonList(new Tree<String>(wordBacktrace.getWord()))));
        } else if (backtrace instanceof UnaryBacktrace) {
          UnaryBacktrace unaryBacktrace = (UnaryBacktrace) backtrace;
          List<Tree<String>> childTrees = unaryBacktrace.getChildEdge().getTrees();
          for (Tree<String> childTree : childTrees) {
            List<Tree<String>> children = Collections.singletonList(childTree);
            trees.add(new Tree<String>(getLabel(), children));
          }
        } else if (backtrace instanceof BinaryBacktrace) {
          BinaryBacktrace binaryBacktrace = (BinaryBacktrace) backtrace;
          List<Tree<String>> leftTrees = binaryBacktrace.getLeftEdge().getTrees();
          List<Tree<String>> rightTrees = binaryBacktrace.getRightEdge().getTrees();
          for (Tree<String> leftTree : leftTrees) {
            for (Tree<String> rightTree : rightTrees) {
              List<Tree<String>> children = new ArrayList<Tree<String>>(2);
              children.add(leftTree);
              children.add(rightTree);
              trees.add(new Tree<String>(getLabel(), children));
            }
          }
        }
      }
      return trees;
    }