@Test
	public void testSharedKeyBindingGetsRestoredWhenToolIsRestarted() throws Exception {

		setKeyBindingsUpDialog();

		// this action is known to be a 'Shared' action
		// Remove Items  (Shared)
		String actionName = "Remove Items";
		DockingActionIf action = getAction(tool, ToolConstants.SHARED_OWNER, actionName);
		assertNotNull(action);
		KeyStroke defaultBinding = action.getKeyBinding();
		KeyStroke newBinding = KeyStroke.getKeyStroke(KeyEvent.VK_X, 0);
		assertNotEquals(defaultBinding, newBinding);
		setKeyBinding(action, "x", newBinding.getKeyCode());

		KeyStroke appliedBinding = action.getKeyBinding();
		assertEquals(newBinding, appliedBinding);

		// reload the tool and make sure the values are those of the changes get restored
		saveAndCloseTool();

		reopenTool(tool);

		KeyStroke restoredBinding = action.getKeyBinding();
		assertEquals(newBinding, restoredBinding);

		setKeyBindingsUpDialog(tool);
		ToolOptions options = tool.getOptions(DockingToolConstants.KEY_BINDINGS);
		ActionTrigger actionTrigger = options.getActionTrigger(action.getFullName(), null);
		KeyStroke optionKeyStroke = actionTrigger.getKeyStroke();
		assertEquals(appliedBinding, optionKeyStroke);

		closeAllWindows();
	}
Tests the {@link KeyBindingUtils} class.


@since  Tracker Id 329
Ghidra/Features/Base/src/test.slow/java/ghidra/framework/plugintool/dialog/KeyBindingUtilsTest.java