private CallTree selectInRootNodeList(final NodeList rootNodeList, boolean bestMatchingState) {
        // in root list
        if (rootNodeList.size() == 1) {
            logger.info("Select root span in top node list");

            final Node node = rootNodeList.get(0);

            if (bestMatchingState) {
                traceState.complete();
            } else {
                traceState.progress();
            }
            return node.getSpanCallTree();
        }
        // find focus
        final NodeList focusNodeList = rootNodeList.filter(this.focusFilter);
        if (focusNodeList.size() == 1) {
            logger.info("Select root & focus span in top node list");
            final Node node = focusNodeList.get(0);
            traceState.progress();
            return node.getSpanCallTree();
        } else if (focusNodeList.size() > 1) {
            logger.info("Select first root & focus span in top node list");
            final Node node = focusNodeList.get(0);
            traceState.progress();
            return node.getSpanCallTree();
        }
        // not found focus
        logger.info("Select first root span in top node list, not found focus span");
        final Node node = rootNodeList.get(0);
        traceState.progress();
        return node.getSpanCallTree();
    }
@author netspider
@author emeroad
@author jaehong.kim
web/src/main/java/com/navercorp/pinpoint/web/calltree/span/SpanAligner.java