@Test
    public void assertIsValid() {
        populateSpanTree();
        root.clearChildren(1);
        root.remove(span3);

        assertTrue(root.isValid());
        assertTrue(span1.isValid());
        assertTrue(span2.isValid());

        assertFalse(span3.isValid());
        assertFalse(alternate1.isValid());
        assertFalse(span11.isValid());
        assertFalse(branch.isValid());
        assertFalse(span22.isValid());
        assertFalse(alternate2.isValid());
        assertFalse(span33.isValid());
        assertFalse(branch1.isValid());
        assertFalse(span333.isValid());
        assertFalse(span111.isValid());
        assertFalse(span222.isValid());
    }
@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