private Collection<ValidationEvent> getValidationEvents(TextInstance instance) {
        final Collection<ValidationEvent> events = new ArrayList<>();
        for (Map.Entry<String, List<String>> termEntry : termsMap.entrySet()) {
            final String termLower = termEntry.getKey().toLowerCase();
            final int startIndex = instance.getText().toLowerCase().indexOf(termLower);
            if (startIndex != -1) {
                final String matchedText = instance.getText().substring(startIndex, startIndex + termLower.length());
                events.add(constructValidationEvent(instance, termEntry.getValue(), matchedText));
            }
        }
        return events;
    }
Generates zero or more @see ValidationEvents and returns them in a collection.

@param instance text occurrence found in the body of the model
smithy-linters/src/main/java/software/amazon/smithy/linters/NoninclusiveTermsValidator.java