@Override
    public V replace(K key, V newValue) {
        begin();
        V oldValue = transactionalMap.replace(key, newValue);
        commit();
        return oldValue;
    }
@Test
    public void testReplace() {
        map.put(42, "oldValue");

        String oldValue = adapter.replace(42, "newValue");

        assertEquals("oldValue", oldValue);
        assertEquals("newValue", map.get(42));
    }