@Test
public void testAdd() {

    final ScopedSet<String> set = new ScopedSet<String>(observer);
    final String test1 = "test1";
    final String test2 = "test2";
    final String test3 = "test2";
    
    Assert.assertFalse(set.contains(test1));
    Assert.assertFalse(set.contains(test2));
    set.add(test1);
    set.add(test2);
    Assert.assertTrue(set.contains(test1));
    Assert.assertTrue(set.contains(test2));
    Assert.assertEquals(2, set.size());
    set.add(test3);
    Assert.assertTrue(set.contains(test1));
    Assert.assertTrue(set.contains(test2));
    Assert.assertEquals(2, set.size());
    set.enterScope(Scope.SESSION, Scope.DOCUMENT);
    final String test4 = "test4";
    set.add(test4);
    set.add(test3);
    Assert.assertTrue(set.contains(test1));
    Assert.assertTrue(set.contains(test2));
    Assert.assertTrue(set.contains(test4));
    Assert.assertEquals(3, set.size());
    set.exitScope(Scope.DOCUMENT, Scope.SESSION);
    Assert.assertTrue(set.contains(test1));
    Assert.assertTrue(set.contains(test2));
    Assert.assertFalse(set.contains(test4));
    Assert.assertEquals(2, set.size());
}