@Test
    public void testRemoveInvalidate() {
        SpanList sl1 = new SpanList();
        Span s1 = new Span(1, 2);

        sl1.add(s1);

        SpanList sl2 = new SpanList();
        try {
            sl2.add(s1);
            fail("Should have failed.");
        } catch (IllegalStateException ise) {
            //OK!
        }

        sl1.remove(0);

        try {
            sl2.add(s1);
            fail("Should have failed.");
        } catch (IllegalStateException ise) {
            //OK!
        }
    }
@author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
document/src/test/java/com/yahoo/document/annotation/SpanListTestCase.java