@Test
	public void testInstructionIterator() throws Exception {
		startTransaction();
		addBlocks("ramblocktwo", "B2", addr(10000));

		listing.clearCodeUnits(addr(0x3ef), addr(0x406), false);

		parseStatic(addr(1100), addr(1500));

		InstructionIterator iter = listing.getInstructions(true);
		Instruction inst = iter.next();
		assertNotNull(inst);
		assertEquals(addr(1100), inst.getMinAddress());

		inst = iter.next();
		assertNotNull(inst);
		assertEquals(addr(1102), inst.getMinAddress());

		inst = iter.next();
		assertNotNull(inst);
		assertEquals(addr(1104), inst.getMinAddress());

		while (iter.hasNext()) {
			inst = iter.next();
			assertNotNull(inst);
		}
		assertEquals(addr(1500), inst.getMinAddress());

		parseStatic(addr(1700), addr(1705));
		parseStatic(addr(1801), addr(2453));
		parseStatic(addr(10000), addr(10100));

		endTransaction();

		int instCount = 0;
		int instLen = 0;
		InstructionIterator instIt = listing.getInstructions(true);
		while (instIt.hasNext()) {
			inst = instIt.next();
			instCount++;
			instLen += inst.getLength();
		}

		assertEquals(582, instCount);
		assertEquals(1164, instLen);

		assertEquals(582, listing.getNumInstructions());
	}
** Diagnostic Aid ** Open program in tool
@throws Exception
Ghidra/Features/Base/src/test.slow/java/ghidra/program/database/code/CodeUnitIteratorTest.java