@Test
	public void testMemoryBlockExpandUp() throws Exception {
		// expand up: create a block, then join to its successor

		disableCodeBrowserLocationEvents();

		env.showTool();
		Address addr = getAddr(0x01001000);
		MemoryBlock block = memory.getBlock(addr);
		GoToService goToService = tool.getService(GoToService.class);
		goToService.goTo(new ProgramLocation(program, addr));

		Address newaddr = getAddr(0x01000500);

		txSwing(() -> {
			MemoryBlock newblock =
				memory.createInitializedBlock(".test", newaddr, 0xb00, (byte) 0, null, false);
			memory.join(newblock, block);
		});

		ByteViewerComponent c = panel.getCurrentComponent();
		FieldLocation loc = getFieldLocation(newaddr);
		ByteField field = c.getField(loc.getIndex(), loc.getFieldNum());
		assertNotNull(field);

		// cursor should remain where it was before the block expansion
		loc = c.getCursorLocation();
		assertEquals(getFieldLocation(addr), loc);

		// there should be no separator above the current location
		field = c.getField(loc.getIndex().subtract(BigInteger.ONE), 0);
		assertFalse(field.getText().equals(".."));
	}
Test editing in the Byte Viewer.
Ghidra/Features/ByteViewer/src/test.slow/java/ghidra/app/plugin/core/byteviewer/ByteViewerPlugin2Test.java