@Test
    public void testIteratorRecursive() {
        AlternateSpanList asl1 = new AlternateSpanList();

        Span span10 = new Span(1, 1);
        Span span20 = new Span(2, 1);
        Span span30 = new Span(3, 1);
        List<SpanNode> subTree0 = new ArrayList<>(3);
        subTree0.add(span10);
        subTree0.add(span20);
        subTree0.add(span30);

        Span span11 = new Span(4, 1);
        Span span21 = new Span(5, 1);
        Span span31 = new Span(6, 1);
        SpanList sl112 = new SpanList();
        sl112.add(span11);
        sl112.add(span21);
        sl112.add(span31);
        SpanList sl11 = new SpanList();
        sl11.add(sl112);
        List<SpanNode> subTree1 = new ArrayList<>(1);
        subTree1.add(sl11);

        Span span12 = new Span(7, 1);
        Span span22 = new Span(8, 1);
        Span span32 = new Span(9, 1);
        List<SpanNode> subTree2 = new ArrayList<>(3);
        subTree2.add(span12);
        subTree2.add(span22);
        subTree2.add(span32);

        asl1.addChildren(0, subTree0, 0.1);
        asl1.addChildren(1, subTree1, 0.1);
        asl1.addChildren(2, subTree2, 0.1);

        ListIterator<SpanNode> it = asl1.childIteratorRecursive();
        assertSame(span10, it.next());
        assertSame(span20, it.next());
        assertSame(span30, it.next());
        assertSame(span11, it.next());
        assertSame(span21, it.next());
        assertSame(span31, it.next());
        assertSame(sl112, it.next());
        assertSame(sl11, it.next());
        assertSame(span12, it.next());
        assertSame(span22, it.next());
        assertSame(span32, it.next());
        assertFalse(it.hasNext());
    }
@author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
document/src/test/java/com/yahoo/document/annotation/AlternateSpanListTestCase.java