private void setNewLayout(String layoutName) {

		/*
		 	Note: we use LayoutProvider<?, ?, ?> here instead of 
		 	      LayoutProvider<SampleVertex, SampleEdge, SampleGraph> simply because
		 	      the former is more concise
		 */

		@SuppressWarnings("unchecked")
		MultiStateDockingAction<LayoutProvider<?, ?, ?>> relayoutAction =
			(MultiStateDockingAction<LayoutProvider<?, ?, ?>>) getAction(plugin,
				SampleGraphProvider.RELAYOUT_GRAPH_ACTION_NAME);

		// sanity check
		ActionState<LayoutProvider<?, ?, ?>> currentChoice = relayoutAction.getCurrentState();
		if (layoutName.equals(currentChoice.getUserData().getLayoutName())) {
			fail("Layout already selected--pick a new layout '" + layoutName + "'");
		}

		ActionState<LayoutProvider<?, ?, ?>> desiredChoice = null;
		List<ActionState<LayoutProvider<?, ?, ?>>> choices = relayoutAction.getAllActionStates();
		for (ActionState<LayoutProvider<?, ?, ?>> choice : choices) {

			LayoutProvider<?, ?, ?> layoutProvider = choice.getUserData();
			if (layoutName.equals(layoutProvider.getLayoutName())) {
				desiredChoice = choice;
				break;
			}
		}

		assertNotNull("Could not find layout '" + layoutName + "'", desiredChoice);

		ActionState<LayoutProvider<?, ?, ?>> theChoice = desiredChoice;
		runSwing(() -> relayoutAction.setCurrentActionState(theChoice));
	}
An integration test for the {@link SampleGraphPlugin}.   These tests are really just
regression tests meant to catch if the sample plugin gets broken.  The functionality of
the plugin is barely tested.
Ghidra/Extensions/sample/src/test.slow/java/ghidra/examples/graph/SampleGraphPluginTest.java