@Test
public void testPut() {

    final ScopedMap<String, String> map =
            new ScopedMap<String, String>(observer);
    Assert.assertNull(map.put("key1", "value1"));
    Assert.assertEquals("value1", map.get("key1"));
    Assert.assertNull(map.put("key2", "value2"));
    Assert.assertEquals("value1", map.get("key1"));
    Assert.assertEquals("value2", map.get("key2"));
    map.enterScope(Scope.SESSION, Scope.DOCUMENT);
    Assert.assertEquals("value1", map.get("key1"));
    Assert.assertEquals("value2", map.get("key2"));
    Assert.assertEquals("value2", map.put("key2", "value3"));
    Assert.assertEquals("value1", map.get("key1"));
    Assert.assertEquals("value3", map.get("key2"));
    Assert.assertNull(map.put("key3", "value3"));
    Assert.assertEquals("value3", map.get("key3"));
    map.exitScope(Scope.DOCUMENT, Scope.SESSION);
    Assert.assertEquals("value1", map.get("key1"));
    Assert.assertTrue(map.containsKey("key1"));
    Assert.assertEquals("value2", map.get("key2"));
    Assert.assertNull(map.get("key3"));
    Assert.assertFalse(map.containsKey("key3"));
}