@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}
		if (obj == this) {
			return true;
		}
		if (obj instanceof MemReferenceDB) {
			MemReferenceDB memRef = (MemReferenceDB) obj;
			if (program == memRef.program) {
				return fromAddr.equals(memRef.getFromAddress()) &&
					toAddr.equals(memRef.getToAddress()) && opIndex == memRef.getOperandIndex() &&
					symbolID == memRef.getSymbolID() && isPrimary == memRef.isPrimary() &&
					sourceType == memRef.getSource() && refType == memRef.getReferenceType() &&
					isShiftedReference() == memRef.isShiftedReference() &&
					isOffsetReference() == memRef.isOffsetReference();
			}
			Address compatibleFromAddr =
				SimpleDiffUtility.getCompatibleAddress(program, fromAddr, memRef.program);
			if (compatibleFromAddr == null) {
				compatibleFromAddr = fromAddr;
			}
			if (!compatibleFromAddr.equals(memRef.fromAddr) || opIndex != memRef.opIndex ||
				sourceType != memRef.sourceType || refType != memRef.getReferenceType() ||
				toAddr.getOffset() != memRef.toAddr.getOffset() ||
				isPrimary != memRef.isPrimary() ||
				isShiftedReference() != memRef.isShiftedReference() ||
				isOffsetReference() != memRef.isOffsetReference()) {
				return false;
			}
			return true;
		}
		else if (obj instanceof Reference) {
			Reference ref = (Reference) obj;
			return fromAddr.equals(ref.getFromAddress()) && toAddr.equals(ref.getToAddress()) &&
				opIndex == ref.getOperandIndex() && symbolID == ref.getSymbolID() &&
				isPrimary == ref.isPrimary() && sourceType == ref.getSource() &&
				refType == ref.getReferenceType() &&
				isShiftedReference() == ref.isShiftedReference() &&
				isOffsetReference() == ref.isOffsetReference();
		}
		return false;

	}
@see java.lang.Object#equals(Object)
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/references/MemReferenceDB.java