@Test
	public void testNextAfterUndoRedo() throws Exception {
		//
		// Note: the addresses used here are arbitrary, except that there is an undefined are
		//       we can use to create data
		//

		Address addr = getAddr(0x01001010);
		goToService.goTo(addr);

		// Create a data to later delete
		CreateDataCmd cmd = new CreateDataCmd(addr, new ByteDataType());
		int id = program.startTransaction("TEST");
		cmd.applyTo(program);
		program.endTransaction(id, true);
		cb.updateNow();

		// move the cursor
		Address addr2 = getAddr(0x01001020);
		goToService.goTo(addr2);

		// do the undo (must use the action as its the one that updates nav history)
		performAction(undoAction, provider, true);
		cb.updateNow();

		// verify the address went back to spot where data was created.
		ProgramLocation loc = cb.getCurrentLocation();
		assertEquals(addr, loc.getAddress());

		// do the next action and make sure it went to 1001020, which is
		// where we were before the undo
		performAction(prevAction, provider, true);
		cb.updateNow();
		loc = cb.getCurrentLocation();
		assertEquals(addr2, loc.getAddress());

		// now go to a new location to test redo
		Address addr3 = getAddr(0x1001030);
		goToService.goTo(addr3);

		// do the redo and verify we are back to 1001020,  which is
		// where we were when we did the undo
		performAction(redoAction, provider, true);
		cb.updateNow();
		loc = cb.getCurrentLocation();
		assertEquals(addr2, loc.getAddress());

		// now check that the previous history has the location we were at when we did redo
		performAction(prevAction, provider, true);
		cb.updateNow();
		loc = cb.getCurrentLocation();
		assertEquals(addr3, loc.getAddress());

	}
Tests for tool state history plugin.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/navigation/NavigationHistoryPluginTest.java