@Test
	public void testUndoEdit() throws Exception {
		// make changes in one
		// verify the other tools shows the changes in red

		env.showTool();
		showTool(tool2);
		final ToggleDockingAction action =
			(ToggleDockingAction) getAction(pluginOne, "Enable/Disable Byteviewer Editing");
		final FieldLocation loc = getFieldLocation(pluginOne, getAddr(0x01001000));
		runSwing(() -> {
			ByteViewerComponent c = panelOne.getCurrentComponent();
			c.setCursorPosition(loc.getIndex(), loc.getFieldNum(), 0, 0);
			action.setSelected(true);
			action.actionPerformed(new DefaultActionContext());
		});
		assertTrue(action.isSelected());
		final ByteViewerComponent c = panelOne.getCurrentComponent();
		runSwing(() -> {
			KeyEvent ev = new KeyEvent(c, 0, new Date().getTime(), 0, KeyEvent.VK_1, '1');
			c.keyPressed(ev, loc.getIndex(), loc.getFieldNum(), loc.getRow(), loc.getCol(),
				c.getCurrentField());
		});
		program.flushEvents();

		ByteViewerComponent c2 = panel2.getCurrentComponent();
		ByteField f2 = c2.getField(BigInteger.ZERO, 0);
		assertEquals(ByteViewerComponentProvider.CHANGED_VALUE_COLOR, f2.getForeground());

		undo(program);

		f2 = c2.getField(BigInteger.ZERO, 0);
		assertNull(f2.getForeground());
	}
Tests for two byte viewers connected.
Ghidra/Features/ByteViewer/src/test.slow/java/ghidra/app/plugin/core/byteviewer/ByteViewerConnectedToolBehaviorTest.java