private synchronized void indexFile(DomainFile file) {
		String newFileId = file.getFileID();
		if (newFileId == null) {
			return;
		}

		Map<String, String> metadata = file.getMetadata();
		for (IndexInfo index : indexes) {
			Object indexedValue = index.mappingFunc.apply(file, metadata);
			if (indexedValue != null) {
				Object fileInfo = index.indexedFiles.get(indexedValue);
				if (fileInfo == null) {
					index.indexedFiles.put(indexedValue, newFileId);
				}
				else if (fileInfo instanceof List<?> fileInfoList) {
					((List<String>) fileInfoList).add(newFileId);
				}
				else if (fileInfo instanceof String prevFileId) {
					if (newFileId.equals(prevFileId)) {
						// don't need to do anything
						continue;
					}
					List<String> fileInfoList = new ArrayList<>();
					fileInfoList.add(prevFileId);
					fileInfoList.add(newFileId);
					index.indexedFiles.put(indexedValue, fileInfoList);
				}
			}
		}
	}
@param indexType IndexType enum
@param mappingFunc bifunc that returns value that will be used to lookup the file
@param indexedFiles map of index keyvalue to fileId (either string or list of strings)
Ghidra/Features/Base/src/main/java/ghidra/plugin/importer/ProjectIndexService.java