@Test
	public void testBlockReplaced() throws Exception {
		MemoryBlock[] blocks = memory.getBlocks();
		tool.execute(new AddUninitializedMemoryBlockCmd(".test", "comments", "test", getAddr(0),
			0x100, true, true, true, false, false), program);
		waitForBusyTool(tool);
		JTable table = provider.getTable();
		assertEquals(blocks.length + 1, table.getModel().getRowCount());
		assertEquals(".test", table.getModel().getValueAt(0, MemoryMapModel.NAME));
		assertEquals("Default", table.getModel().getValueAt(0, MemoryMapModel.BLOCK_TYPE));
		assertTrue(!((Boolean) table.getModel().getValueAt(0, MemoryMapModel.INIT)).booleanValue());

		tx(program, () -> {
			memory.convertToInitialized(memory.getBlock(getAddr(0)), (byte) 0xff);
		});

		assertTrue(((Boolean) table.getModel().getValueAt(0, MemoryMapModel.INIT)).booleanValue());

		assertEquals(blocks.length + 1, table.getModel().getRowCount());
	}
Test the MemoryMapPlugin for domain object events.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/memory/MemoryMapPluginTest.java