@Before
    public void buildTree() {
        AnnotationType at1 = new AnnotationType("person", DataType.STRING);
        AnnotationType at2 = new AnnotationType("street", DataType.STRING);
        AnnotationType at3 = new AnnotationType("city", DataType.STRING);

        StringFieldValue fv1 = (StringFieldValue) at1.getDataType().createFieldValue();
        fv1.assign("Praveen");
        Annotation an1 = new Annotation(at1, fv1);

        StringFieldValue fv2 = (StringFieldValue) at2.getDataType().createFieldValue();
        fv2.assign("Bommanahalli");
        Annotation an2 = new Annotation(at2, fv2);

        StringFieldValue fv3 = (StringFieldValue) at3.getDataType().createFieldValue();
        fv3.assign("Bangalore");
        Annotation an3 = new Annotation(at3, fv3);


        StringFieldValue fv11 = (StringFieldValue) at1.getDataType().createFieldValue();
        fv11.assign("Elancheran");
        Annotation an11 = new Annotation(at1, fv11);

        StringFieldValue fv22 = (StringFieldValue) at2.getDataType().createFieldValue();
        fv22.assign("Kagadaspura");
        Annotation an22 = new Annotation(at2, fv22);

        StringFieldValue fv33 = (StringFieldValue) at3.getDataType().createFieldValue();
        fv33.assign("Delhi");
        Annotation an33 = new Annotation(at3, fv33);

        StringFieldValue fv111 = (StringFieldValue) at1.getDataType().createFieldValue();
        fv111.assign("Govindan");
        Annotation an111 = new Annotation(at1, fv111);

        StringFieldValue fv222 = (StringFieldValue) at1.getDataType().createFieldValue();
        fv222.assign("Kenneth");
        Annotation an222 = new Annotation(at2, fv222);

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


        SpanNode sn1 = new Span(0, 5);
        SpanNode sn2 = new Span(5, 10);
        SpanNode sn3 = new Span(15, 10);
        SpanNode sn4 = new Span(15, 20);

        SpanNode span1 = new Span(0, 3);
        SpanNode span2 = new Span(1, 9);
        SpanNode span3 = new Span(12, 10);

        root.add(sn4);
        root.add(sn3);
        root.add(sn2);
        root.add(sn1);

        SpanNode spn1 = new Span(4, 5);
        branch2.add(spn1);

        AlternateSpanList branch3 = new AlternateSpanList();

        SpanNode spn2 = new Span(1, 4);
        SpanNode spn3 = new Span(6, 10);
        tree.annotate(spn2, an111);
        tree.annotate(spn3, an222);

        List<SpanNode> stList = new ArrayList<SpanNode>();
        stList.add(spn2);
        List<SpanNode> stList1 = new ArrayList<SpanNode>();
        stList1.add(spn3);
        branch3.addChildren(stList, 45.0);
        branch3.addChildren(stList1, 25.0);

        root.add(branch2);
        branch.add(branch3);
        root.add(branch);

        SpanNode span11 = new Span(0, 3);
        SpanNode span22 = new Span(1, 9);
        SpanNode span33 = new Span(12, 10);

        SpanList alternate2 = new SpanList();
        alternate2.add(span3);
        alternate2.add(span2);
        alternate2.add(span1);

        SpanList alternate1 = new SpanList();
        alternate1.add(span11);
        alternate1.add(span22);
        alternate1.add(span33);

        tree.annotate(span1, an1);
        tree.annotate(span2, an2);
        tree.annotate(span3, an3);

        tree.annotate(span11, an11);
        tree.annotate(span22, an22);
        tree.annotate(span33, an33);

        List<SpanNode> subtreeList1 = new ArrayList<SpanNode>();
        subtreeList1.add(alternate1);

        List<SpanNode> subtreeList2 = new ArrayList<SpanNode>();
        subtreeList2.add(alternate2);

        branch.addChildren(subtreeList1, 50.0d);
        branch.addChildren(subtreeList2, 100.0d);
    }
@author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
document/src/test/java/com/yahoo/document/annotation/Bug4155865TestCase.java