protected void runIteratorTest(AddressSet a, AddressSet b, boolean forward) {
		AddressSet both = a.intersect(b);
		AddressSet left = a.subtract(b);
		AddressSet right = b.subtract(a);

		TwoWayBreakdownAddressRangeIterator it = makeIterator(a, b, forward);
		while (it.hasNext()) {
			Entry<AddressRange, Which> next = it.next();
			AddressSet which;
			switch (next.getValue()) {
				case BOTH:
					which = both;
					break;
				case LEFT:
					which = left;
					break;
				case RIGHT:
					which = right;
					break;
				default:
					throw new AssertionError();
			}
			if (forward) {
				assertEquals(which.getMinAddress(), next.getKey().getMinAddress());
			}
			else {
				assertEquals(which.getMaxAddress(), next.getKey().getMaxAddress());
			}
			which.delete(next.getKey());
		}

		assertTrue(both.isEmpty());
		assertTrue(left.isEmpty());
		assertTrue(right.isEmpty());
	}
Copies each entry into a new list, since the iterator may modify the entry in place

@param it the source iterator
@return the destination (new) list
Ghidra/Debug/ProposedUtils/src/test/java/ghidra/util/TwoWayBreakdownAddressRangeIteratorTest.java