void () { KeymapImpl standalone = new KeymapImpl(); standalone.setName("standalone"); String BASE1 = "BASE_ACTION1"; String DEPENDENT1 = "DEPENDENT_ACTION1"; String BASE2 = "BASE_ACTION2"; String DEPENDENT2 = "DEPENDENT_ACTION2"; KeymapManagerEx.getInstanceEx().bindShortcuts(BASE1, DEPENDENT1); KeymapManagerEx.getInstanceEx().bindShortcuts(BASE2, DEPENDENT2); try { standalone.addShortcut(ACTION_1, shortcut1); standalone.addShortcut(BASE1, shortcut1); assertTrue(standalone.hasOwnActionId(ACTION_1)); assertFalse(standalone.hasOwnActionId(ACTION_2)); assertTrue(standalone.hasOwnActionId(BASE1)); assertFalse(standalone.hasOwnActionId(DEPENDENT1)); assertFalse(standalone.hasOwnActionId(BASE2)); assertFalse(standalone.hasOwnActionId(DEPENDENT2)); standalone.removeShortcut(ACTION_1, shortcut1); standalone.removeShortcut(ACTION_2, shortcut1); // empty mapping -> should not have any effect standalone.removeShortcut(DEPENDENT1, shortcut1); standalone.removeShortcut(DEPENDENT2, shortcut1); // empty mapping -> should not have any effect assertFalse(standalone.hasOwnActionId(ACTION_1)); assertFalse(standalone.hasOwnActionId(ACTION_2)); assertTrue(standalone.hasOwnActionId(BASE1)); assertTrue(standalone.hasOwnActionId(DEPENDENT1)); assertSameElements(standalone.getShortcuts(BASE1), shortcut1); assertSameElements(standalone.getShortcuts(DEPENDENT1)); assertFalse(standalone.hasOwnActionId(BASE2)); assertFalse(standalone.hasOwnActionId(DEPENDENT2)); } finally{ KeymapManagerEx.getInstanceEx().unbindShortcuts(DEPENDENT1); KeymapManagerEx.getInstanceEx().unbindShortcuts(DEPENDENT2); } }