public void populateSpanTree() {

        root = new AlternateSpanList();
        tree = new SpanTree("test", root);

        span1 = new Span(10, 8);
        span2 = new Span(5, 10);
        span3 = new Span(13, 2);

        span11 = new Span(0, 2);
        span22 = new Span(2, 10);
        span33 = new Span(8, 10);

        span111 = new Span(5, 10);
        span222 = new Span(10, 10);
        span333 = new Span(20, 10);

        an111 = new Annotation(at1);

        tree.annotate(span1, at1).annotate(span2, at2).annotate(span3, at3);
        tree.annotate(span11, at1).annotate(span22, at2).annotate(span33, at3);
        tree.annotate(span111, an111).annotate(span222, at2).annotate(span333, at3).annotate(span333, at1);
        tree.annotate(span222, at2);

        root.add(span3);
        root.add(span2);
        root.add(span1);

        alternate1 = new AlternateSpanList();
        alternate1.add(span11);
        branch = new SpanList();
        branch.add(span22);
        subtreeList1 = new ArrayList<SpanNode>();
        subtreeList1.add(branch);
        alternate1.addChildren(1, subtreeList1, 50.0d);

        alternate2 = new AlternateSpanList();
        alternate2.add(span33);
        subtreeList2 = new ArrayList<SpanNode>();
        subtreeList2.add(span111);
        subtreeList2.add(span222);
        alternate2.addChildren(1, subtreeList2, 70.0d);

        subtreeList3 = new ArrayList<SpanNode>();
        branch1 = new SpanList();
        branch1.add(span333);
        subtreeList3.add(branch1);
        alternate2.addChildren(2, subtreeList3, 90.0d);
        branch.add(alternate2);

        subtreeList4 = new ArrayList<SpanNode>();
        subtreeList4.add(alternate1);
        root.addChildren(1, subtreeList4, 10.0d);
    }
@author <a href="mailto:mpraveen@yahoo-inc.com">Praveen Mohan</a>

This test covers all possible scenarios in SpanNode.
document/src/test/java/com/yahoo/document/annotation/SpanNodeAdvTestCase.java