MapCommand extends Command { protected ModelEvent remove(EditorModel em, String key) { elementMap.remove(key); 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 testRemove() { System.out.println("remove"); MapCommand<String> a; for (int i = 0; i < 4; i++) { a = new MapCommand.RemoveFromMap<String>(m1, "key" + i, root); cm.performCommand(a); assert (!m1.containsKey("key" + i)); } for (int i = 0; i < 4; i++) { cm.undoCommand(); assert (m1.containsKey("key" + (4 - i - 1))); } assert (!cm.canUndo()); for (int i = 0; i < 4; i++) { cm.redoCommand(); assert (!m1.containsKey("key" + i)); } }