public static void assertToggleButtonSelected(JToggleButton button, boolean selected) {
		AtomicBoolean ref = new AtomicBoolean();
		runSwing(() -> ref.set(button.isSelected()));
		Assert.assertEquals("Button not in expected selected state", selected, ref.get());
	}
Checks the selected state of a JToggleButton in a thread safe way.
@param button the toggle button for which to check the selected state.
@param selected the expected state of the toggle button.
Ghidra/Framework/Docking/src/main/java/docking/test/AbstractDockingTest.java