private Collection<RefRepeatComment> getRepeatableComments(boolean showAll) {

		loadReferences();
		int space = getAvailableSpace();
		Set<RefRepeatComment> set = new LinkedHashSet<>();
		for (int i = 0; i < references.size() && set.size() < space; ++i) {
			Reference reference = references.get(i);
			if (!showAll && !reference.isPrimary()) {
				continue;
			}

			Address address = reference.getToAddress();
			String[] comment = getComment(address);
			if (!CollectionUtils.isBlank(comment)) {
				set.add(new RefRepeatComment(address, comment));
			}
		}

		return set;
	}
Check if this address could be a valid address in the program. 0 id not a valid address.

@param program program to check if address is valid within
@param address address in program to be checked
@return true if this is a valid address
Ghidra/Features/Base/src/main/java/ghidra/app/util/EolComments.java