private List<MemoryMatch> getMatchesInRange(Address start, Address end) {
		List<MemoryMatch> matches = getMatches();
		int startIndex = findFirstIndex(matches, start, end);
		if (startIndex < 0) {
			return Collections.emptyList();
		}

		int endIndex = findIndexAtOrGreater(matches, end);
		if (endIndex < matches.size() && (matches.get(endIndex).getAddress().equals(end))) {
			endIndex++; // end index is non-inclusive and we want to include direct hit
		}

		List<MemoryMatch> resultList = matches.subList(startIndex, endIndex);
		return resultList;
	}
Listing highlight provider to highlight memory search results.
Ghidra/Features/Base/src/main/java/ghidra/features/base/memsearch/gui/MemoryMatchHighlighter.java