@Test
	public void testSelectionChanges() throws Exception {
		// selection should track
		showTool(tool2);
		env.showTool();

		final ByteViewerComponent c = panelOne.getCurrentComponent();

		// choose code unit boundaries so that we can compare the
		// selection with the code browser's selection
		runSwing(() -> {
			FieldLocation loc = getFieldLocation(pluginOne, getAddr(0x01001004));
			c.setCursorPosition(loc.getIndex(), loc.getFieldNum(), loc.getRow(), loc.getCol());
			c.scrollToCursor();
		});

		Point startPoint = c.getCursorPoint();
		assertNotNull(startPoint);

		runSwing(() -> {
			FieldLocation loc = getFieldLocation(pluginOne, getAddr(0x010010bb));
			c.setCursorPosition(loc.getIndex(), loc.getFieldNum(), loc.getRow(), loc.getCol());
			c.scrollToCursor();
		});
		Point endPoint = c.getCursorPoint();
		assertNotNull(endPoint);

		dragMouse(c, 1, startPoint.x, startPoint.y, endPoint.x, endPoint.y, 0);
		waitForSwing();

		ByteBlockSelection selOne = c.getViewerSelection();

		ByteBlockSelection sel2 = panel2.getCurrentComponent().getViewerSelection();
		assertTrue(byteBlockSelectionEquals(selOne, sel2));

	}
Tests for two byte viewers connected.
Ghidra/Features/ByteViewer/src/test.slow/java/ghidra/app/plugin/core/byteviewer/ByteViewerConnectedToolBehaviorTest.java