@Test
	public void testAddressRangeIterator() {

		AddressRangeMapDB map = new AddressRangeMapDB(program.getDBHandle(), addrMap,
			new Lock("Test"), "TEST", this, LongField.INSTANCE, true);

		int id = program.startTransaction("TEST");
		try {
			assertNull(map.getValue(addr(0x01000000000L)));

			map.paintRange(addr(0x0000001000L), addr(0x0200001000L), ONE);
			map.paintRange(addr(0x0100000000L), addr(0x0100001000L), TWO);
			map.paintRange(addr(0x0080000000L), addr(0x0100000fffL), THREE);

			map.clearRange(addr(0x0100000000L), addr(0x0100000010L));
			map.clearRange(addr(0x01fffffff0L), addr(0x0200000010L));
		}
		finally {
			program.endTransaction(id, true);
		}

		// All address
		AddressRangeIterator iter = map.getAddressRanges();
		assertTrue(iter.hasNext());
		assertEquals(new AddressRangeImpl(addr(0x0000001000L), addr(0x007fffffffL)), iter.next());
		assertTrue(iter.hasNext());
		assertEquals(new AddressRangeImpl(addr(0x0080000000L), addr(0x00ffffffffL)), iter.next());
		assertTrue(iter.hasNext());
		assertEquals(new AddressRangeImpl(addr(0x0100000011L), addr(0x0100000fffL)), iter.next());
		assertTrue(iter.hasNext());
		assertEquals(new AddressRangeImpl(addr(0x0100001000L), addr(0x0100001000L)), iter.next());
		assertTrue(iter.hasNext());
		assertEquals(new AddressRangeImpl(addr(0x0100001001L), addr(0x01ffffffefL)), iter.next());
		assertTrue(iter.hasNext());
		assertEquals(new AddressRangeImpl(addr(0x0200000011L), addr(0x0200001000L)), iter.next());
		assertTrue(!iter.hasNext());

		// Limited range of addresses starting at 0x0100000100
		iter = map.getAddressRanges(addr(0x0100000100L));
		assertTrue(iter.hasNext());
		assertEquals(new AddressRangeImpl(addr(0x0100000100L), addr(0x0100000fffL)), iter.next());
		assertTrue(iter.hasNext());
		assertEquals(new AddressRangeImpl(addr(0x0100001000L), addr(0x0100001000L)), iter.next());
		assertTrue(iter.hasNext());
		assertEquals(new AddressRangeImpl(addr(0x0100001001L), addr(0x01ffffffefL)), iter.next());
		assertTrue(iter.hasNext());
		assertEquals(new AddressRangeImpl(addr(0x0200000011L), addr(0x0200001000L)), iter.next());
		assertTrue(!iter.hasNext());

		// Limited range of addresses from 0x0100000100 to 0x0200000100L
		iter = map.getAddressRanges(addr(0x0100000100L), addr(0x0200000100L));
		assertTrue(iter.hasNext());
		assertEquals(new AddressRangeImpl(addr(0x0100000100L), addr(0x0100000fffL)), iter.next());
		assertTrue(iter.hasNext());
		assertEquals(new AddressRangeImpl(addr(0x0100001000L), addr(0x0100001000L)), iter.next());
		assertTrue(iter.hasNext());
		assertEquals(new AddressRangeImpl(addr(0x0100001001L), addr(0x01ffffffefL)), iter.next());
		assertTrue(iter.hasNext());
		assertEquals(new AddressRangeImpl(addr(0x0200000011L), addr(0x0200000100L)), iter.next());
		assertTrue(!iter.hasNext());
	}
@see db.util.ErrorHandler#dbError(java.io.IOException)
Ghidra/Features/Base/src/test.slow/java/ghidra/program/database/map/AddressRangeMapDBTest.java