@Test
	public void testSelectionAcrossBlocks() throws Exception {
		env.showTool();
		ByteViewerOptionsDialog dialog = launchByteViewerOptions();
		setViewSelected(dialog, "Ascii", true);
		setViewSelected(dialog, "Octal", true);
		pressButtonByText(dialog.getComponent(), "OK");

		ByteViewerOptionsDialog d = launchByteViewerOptions();
		FixedBitSizeValueField field =
			(FixedBitSizeValueField) getInstanceField("bytesPerLineField", d);
		runSwing(() -> field.setValue(BigInteger.valueOf(10)));
		pressButtonByText(d.getComponent(), "OK");

		// add the block		
		txSwing(() -> {
			Address addr = getAddr(0x30);
			memory.createInitializedBlock(".test", addr, 0x12, (byte) 0, null, false);

			// add the second block at 0x48
			Address addr2 = getAddr(0x48);
			memory.createInitializedBlock(".test2", addr2, 0x100, (byte) 0, null, false);
		});

		runSwing(() -> {
			ByteViewerComponent c = panel.getCurrentComponent();
			Address a = getAddr(0x30);
			FieldLocation loc = getFieldLocation(a);
			c.setCursorPosition(loc.getIndex(), loc.getFieldNum(), loc.getRow(), loc.getCol());
		});
		FieldSelection fsel = new FieldSelection();
		ByteViewerComponent c = panel.getCurrentComponent();
		FieldLocation loc1 = c.getCursorLocation();
		FieldLocation loc2 = getFieldLocation(getAddr(0x000000cb));
		fsel.addRange(new FieldLocation(loc1.getIndex(), loc1.getFieldNum(), 0, 0),
			new FieldLocation(loc2.getIndex(), loc2.getFieldNum(), 0, 0));

		runSwing(() -> {
			ByteViewerComponent currentComponent = panel.getCurrentComponent();
			currentComponent.selectionChanged(fsel, EventTrigger.GUI_ACTION);
		});
		c = panel.getCurrentComponent();
		ByteBlockSelection sel = c.getViewerSelection();
		ByteViewerComponent octalC = findComponent(panel, "Octal");
		assertTrue(byteBlockSelectionEquals(sel, octalC.getViewerSelection()));

		ByteViewerComponent asciiC = findComponent(panel, "Ascii");
		assertTrue(byteBlockSelectionEquals(sel, asciiC.getViewerSelection()));

	}
Test editing in the Byte Viewer.
Ghidra/Features/ByteViewer/src/test.slow/java/ghidra/app/plugin/core/byteviewer/ByteViewerPlugin2Test.java