protected Loaded<Program> findLibraryInLoadedList(List<Loaded<Program>> loadedPrograms,
			String libraryName) {
		Comparator<String> comparator = getLibraryNameComparator();
		boolean noExtension = FilenameUtils.getExtension(libraryName).equals("");
		boolean absolute = libraryName.startsWith("/");
		for (Loaded<Program> loadedProgram : loadedPrograms) {
			String candidateName = loadedProgram.getName();
			if (isOptionalLibraryFilenameExtensions() && noExtension) {
				candidateName = FilenameUtils.getBaseName(candidateName);
			}
			if (absolute) {
				String loadedProgramPath = loadedProgram.getProjectFolderPath() + candidateName;
				if (loadedProgramPath.endsWith(libraryName)) {
					return loadedProgram;
				}
			}
			else if (comparator.compare(candidateName, libraryName) == 0) {
				return loadedProgram;
			}
		}
		return null;
	}
Find the library within the given {@link List} of {@link Loaded} {@link Program}s

@param loadedPrograms the list of {@link Loaded} {@link Program}s
@param libraryName The library name to lookup.  Depending on the type of library, this could
  be a simple filename or an absolute path.
@return The found {@link Loaded} {@link Program} or null if not found
Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/AbstractLibrarySupportLoader.java