List<MemoryMatch> getMatches() {

		if (sortedResults != null) {
			return sortedResults;
		}

		if (model.isBusy()) {
			return Collections.emptyList();
		}

		List<MemoryMatch> modelData = model.getModelData();
		if (model.isSortedOnAddress()) {
			return modelData;
		}

		sortedResults = new ArrayList<>(modelData);
		Collections.sort(sortedResults);

		return sortedResults;
	}
Listing highlight provider to highlight memory search results.
Ghidra/Features/Base/src/main/java/ghidra/features/base/memsearch/gui/MemoryMatchHighlighter.java