protected void onLinesRemoved(int startLine, int endLine) {
		logger.debugging(l -> l.trace("Lines removed: {}-{}", startLine, endLine));

		// We will want to sort the order of removed lines so we
		TreeSet<Map.Entry<Integer, List<Problem>>> set = new TreeSet<>(Comparator.comparingInt(Map.Entry::getKey));
		synchronized (problems) {set.addAll(problems.entrySet());}
		set.stream()
				.filter(e -> e.getKey() >= startLine)
				.forEach(e -> {
					int line = e.getKey();
					List<Problem> list = e.getValue();

					// Shift all problems up by the shift amount
					int shift = endLine - startLine;
					removeByLine(line);

					// Don't add problem back if it's in the removed range
					list.stream()
							.filter(p -> p.line() < startLine || p.line() > endLine)
							.forEach(p -> {
								logger.debugging(l -> l.trace("Move problem '{}' up {} lines", p.message(), shift));
								add(p.withLine(line - shift));
							});
				});
	}
Shifts problems beyond the given range by {@code endLine - startLine}.
Problems in the removed range are deleted.

@param startLine
		Starting range of lines removed <i>(inclusive)</i>.
@param endLine
		Ending range of lines removed <i>(exclusive)</i>.
recaf-ui/src/main/java/software/coley/recaf/ui/control/richtext/problem/ProblemTracking.java