public static void setToggleActionSelected(ToggleDockingActionIf toggleAction,
			ActionContext context, boolean selected, boolean wait) {

		boolean shouldPerformAction = runSwing(() -> {
			return toggleAction.isSelected() != selected;
		});

		if (shouldPerformAction) {
			performAction(toggleAction, context, wait);
		}
	}
Ensures the given toggle action is in the given selected state.  If it is not, then the
action will be performed.  This call will wait for the action to finish.

@param toggleAction the action
@param context the context for the action
@param selected true if the action is to be selected; false for not selected
@param wait true to wait for the action to finish; false to invoke later
Ghidra/Framework/Docking/src/main/java/docking/test/AbstractDockingTest.java