@Override
	public final boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		if (obj == this) {
			return true;
		}

		if (!(obj instanceof ImmutableAddressSet)) {
			return false;
		}

		ImmutableAddressSet otherSet = (ImmutableAddressSet) obj;
		if (this.getNumAddresses() != otherSet.getNumAddresses()) {
			return false;
		}

		// if don't have same number of ranges, not equal
		if (this.getNumAddressRanges() != otherSet.getNumAddressRanges()) {
			return false;
		}

		AddressRangeIterator otherRanges = otherSet.getAddressRanges();
		AddressRangeIterator myRanges = getAddressRanges();
		while (myRanges.hasNext()) {
			AddressRange myRange = myRanges.next();
			AddressRange otherRange = otherRanges.next();
			if (!myRange.equals(otherRange)) {
				return false;
			}
		}
		return true;
	}
Immutable implementation of the {@link AddressSetView} interface;
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/address/ImmutableAddressSet.java