MapCommand extends Command { protected ModelEvent put(EditorModel em, String key, V value) { elementMap.put(key, value); return new DefaultModelEvent(commandName, this, null, null, changed); } protected  MapCommand(EAdMap<V> map, V value, String oldKey, String newKey,
			DependencyNode... changed); @Override boolean canUndo(); @Override boolean canRedo(); @Override boolean combine(Command other); @Override String toString();  }
@Test public void testPut() { System.out.println("put"); MapCommand<String> a; assert (!cm.canUndo()); assert (!cm.canRedo()); String key = "key11"; String value1 = "value11"; a = new MapCommand.AddToMap<String>(m1, value1, key, root); cm.performCommand(a); assert (m1.get(key).equals(value1)); System.out.println("put"); String value2 = "value12"; a = new MapCommand.AddToMap<String>(m1, value2, key, root); cm.performCommand(a); assert (m1.get(key).equals(value2)); assert (cm.canUndo()); cm.undoCommand(); assert (cm.canRedo()); assert (m1.get(key).equals(value1)); cm.redoCommand(); assert (m1.get(key).equals(value2)); assert (!cm.canRedo()); }