
![image](https://user-images.githubusercontent.com/12162539/50417924-d6cc2b80-0863-11e9-860f-bf9d132db570.png)

final StringBuilder treeSB = new StringBuilder();
        recursive(0, true, "", root, new Callback() {
            @Override
            public void callback(int deep, boolean isLast, String prefix, Node node) {
                final boolean hasChild = !node.children.isEmpty();
                final String stepString = isLast ? STEP_FIRST_CHAR : STEP_NORMAL_CHAR;
                final int stepStringLength = length(stepString);
                treeSB.append(prefix).append(stepString);
                int costPrefixLength = 0;
                if (hasChild) {
                    treeSB.append("+");
                }
                if (isPrintCost
                        && !node.isRoot()) {
                    final String costPrefix = String.format("[%s,%sms]", (node.endTimestamp - root.beginTimestamp), (node.endTimestamp - node.beginTimestamp));
                    costPrefixLength = length(costPrefix);
                    treeSB.append(costPrefix);
                }
                final Scanner scanner = new Scanner(new StringReader(node.data.toString()));
                try {
                    boolean isFirst = true;
                    while (scanner.hasNextLine()) {
                        if (isFirst) {
                            treeSB.append(scanner.nextLine()).append("\n");
                            isFirst = false;
                        } else {
                            treeSB
                                    .append(prefix)
                                    .append(repeat(' ', stepStringLength))
                                    .append(hasChild ? "|" : EMPTY)