@Test
	public void testAddBlock() throws Exception {
		command = new AddInitializedMemoryBlockCmd(".test", "A Test", "new block",
			getNotepadAddr(0x100), 100, true, true, true, false, (byte) 0xa, false);
		assertTrue(applyCmd(notepad, command));
		MemoryBlock block = notepad.getMemory().getBlock(getNotepadAddr(0x100));
		assertNotNull(block);
		assertEquals(MemoryBlockType.DEFAULT, block.getType());
		assertFalse(block.isOverlay());
		byte b = block.getByte(getNotepadAddr(0x100));
		assertEquals((byte) 0xa, b);

		// get the fragment for this block
		Listing listing = notepad.getListing();
		String[] treeNames = listing.getTreeNames();
		ProgramFragment f = listing.getFragment(treeNames[0], getNotepadAddr(0x100));
		assertNotNull(f);
		assertEquals(block.getName(), f.getName());
	}
Test for the add memory block command.
Ghidra/Features/Base/src/test/java/ghidra/app/cmd/memory/AddMemoryBlockCmdTest.java