@Test
    public void testAddRemove() {
        final String NEW_PREFIX = "NEW_";
        Marker parent = factory.getMarker(NEW_PREFIX + PARENT_MARKER_STR);
        Marker child = factory.getMarker(NEW_PREFIX + CHILD_MARKER_STR);
        assertFalse(parent.contains(child));
        assertFalse(parent.contains(NEW_PREFIX + CHILD_MARKER_STR));
        assertFalse(parent.remove(child));

        parent.add(child);

        assertTrue(parent.contains(child));
        assertTrue(parent.contains(NEW_PREFIX + CHILD_MARKER_STR));

        assertTrue(parent.remove(child));

        assertFalse(parent.contains(child));
        assertFalse(parent.contains(NEW_PREFIX + CHILD_MARKER_STR));
        assertFalse(parent.remove(child));
    }
Unit test BasicMarker

@author Ceki G&uuml;lc&uuml;
@author Joern Huxhorn
slf4j-api/src/test/java/org/slf4j/basicTests/BasicMarkerTest.java