@Test
	public void testNext() throws Exception {
		QueryData queryData = new QueryData("sscanf", false);
		goToService.goToQuery(program.getMinAddress(), queryData, null, TaskMonitor.DUMMY);

		assertTrue(plugin.hasPrevious(navigatable));

		assertNotNull(prevAction);
		assertTrue(prevAction.isEnabledForContext(provider.getActionContext(null)));
		assertFalse(nextAction.isEnabledForContext(provider.getActionContext(null)));

		ProgramLocation loc = cb.getCurrentLocation();
		assertTrue(loc instanceof FunctionSignatureFieldLocation);
		Function function = program.getFunctionManager().getFunctionAt(loc.getAddress());

		Parameter param0 = function.getParameter(0);
		Reference[] vrefs = program.getReferenceManager().getReferencesTo(param0);
		Address fromAddr = vrefs[0].getFromAddress();
		VariableXRefFieldLocation xrefLoc =
			new VariableXRefFieldLocation(program, param0, fromAddr, 0, 0);

		goToService.goTo(xrefLoc);
		assertTrue(plugin.hasPrevious(navigatable));
		assertEquals(xrefLoc, cb.getCurrentLocation());

		OperandFieldLocation opLoc = new OperandFieldLocation(program, getAddr(0x01004176),
			(VariableOffset) null, getAddr(0x01004192), "LAB_01004192", 0, 0, 2);
		goToService.goTo(opLoc);
		assertTrue(plugin.hasPrevious(navigatable));

		OperandFieldLocation opLoc2 = new OperandFieldLocation(program, getAddr(0x0100419a),
			(VariableOffset) null, getAddr(0x010041a1), "LAB_010041a1", 0, 0, 0);
		goToService.goTo(opLoc2);

		ProgramLocation[] locations = new ProgramLocation[] { loc, xrefLoc, opLoc, opLoc2 };

		assertTrue(plugin.hasPrevious(navigatable));
		assertEquals(opLoc2, cb.getCurrentLocation());

		performAction(prevAction, provider, true);
		cb.updateNow();
		waitForSwing();
		assertEquals(opLoc, cb.getCurrentLocation());

		performAction(prevAction, provider, true);
		cb.updateNow();
		waitForSwing();
		assertEquals(xrefLoc, cb.getCurrentLocation());

		performAction(prevAction, provider, true);
		cb.updateNow();
		waitForSwing();
		assertEquals(loc, cb.getCurrentLocation());

		assertTrue(prevAction.isEnabledForContext(provider.getActionContext(null)));
		assertTrue(nextAction.isEnabledForContext(provider.getActionContext(null)));

		performAction(prevAction, provider, true);
		cb.updateNow();
		waitForSwing();
		assertEquals(program.getMinAddress(), cb.getCurrentAddress());
		assertFalse(prevAction.isEnabledForContext(provider.getActionContext(null)));

		performAction(nextAction, provider, true);
		cb.updateNow();
		waitForSwing();
		assertEquals(loc, cb.getCurrentLocation());

		performAction(nextAction, provider, true);
		cb.updateNow();
		waitForSwing();
		assertEquals(xrefLoc, cb.getCurrentLocation());

		assertTrue(prevAction.isEnabledForContext(provider.getActionContext(null)));
		assertTrue(nextAction.isEnabledForContext(provider.getActionContext(null)));

		performAction(prevAction, provider, true);
		performAction(prevAction, provider, true);
		assertFalse(prevAction.isEnabledForContext(provider.getActionContext(null)));
		assertTrue(nextAction.isEnabledForContext(provider.getActionContext(null)));

		for (ProgramLocation element : locations) {
			performAction(nextAction, provider, true);
			cb.updateNow();
			waitForSwing();
			assertEquals(element, cb.getCurrentLocation());
		}
		assertFalse(nextAction.isEnabledForContext(provider.getActionContext(null)));
	}
Tests for tool state history plugin.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/navigation/NavigationHistoryPluginTest.java