@Nonnull
	private String replacePatternIn(@Nonnull Model named, @Nonnull String source,
	                                @Nullable String before, @Nullable String after) {
		if (before != null && after != null && !before.equals(after)) {
			Range namedRange = extractRelevantRange(named, source);
			if (namedRange.end() > source.length() || namedRange.isUnknown())
				return source;

			String namedSource = getSource(namedRange, source);
			String prefix = source.substring(0, namedRange.begin());
			String suffix = source.substring(namedRange.end());
			String replaced = namedSource.replace(before, after);

			// TODO: We should ensure only one replacement ever happens.
			//  - We could only replace if the content replaced is surrounded by boundaries.
			//  - Or just validate our range only has one instance of the 'before' text in it

			if (!replaced.equals(namedSource))
				return prefix + replaced + suffix;
		}
		return source;
	}
@return Modified source code based on the provided mappings.
recaf-core/src/main/java/software/coley/recaf/services/source/AstMapper.java