@Test
    public void testTwoLevelFromAndTo() {
        SpanList root = new SpanList();
        SpanList l1 = new SpanList();
        root.add(l1);

        Span s1 = new Span(0, 20);
        Span s2 = new Span(20, 20);

        l1.add(s1).add(s2);

        assertEquals(0, root.getFrom());
        assertEquals(40, root.getTo());
        assertEquals(0, l1.getFrom());
        assertEquals(40, l1.getTo());

        Span s3 = new Span(40, 20);
        l1.add(s3);

        assertEquals(0, root.getFrom());
        assertEquals(60, root.getTo());
        assertEquals(0, l1.getFrom());
        assertEquals(60, l1.getTo());
    }
@author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
document/src/test/java/com/yahoo/document/annotation/SpanListTestCase.java