void (TreeNode node, int level, StringBuilder result) { result.append(" ".repeat(level)).append(myPresenter.apply(node)).append("\n"); for (int i = 0; i < node.getChildCount(); i++) { printSubTree(node.getChildAt(i), level+1, result); } }