private Collection<String> getReferencePreviews() {

		loadReferences();
		if (references.isEmpty()) {
			return getPreviewForNoReferences();
		}

		int space = getAvailableSpace();
		Program program = codeUnit.getProgram();
		Set<String> set = new LinkedHashSet<>();
		for (Reference reference : references) {

			if (set.size() >= space) {
				break;
			}

			if (!isValidReference(program, reference)) {
				continue;
			}

			createAutoCommentFromReference(set, program, reference);
		}

		return set;
	}
Returns the number of comments that can be added before reaching the maximum number of
comments
@return the number of comments
Ghidra/Features/Base/src/main/java/ghidra/app/util/EolComments.java