### Question:
ConstantLocations implements SemanticLocations { @Override public boolean containsToken(@Nonnull MyDocumentModel document, @Nonnull String token) { return document.getAnalysisResult().getConstantDefinitions().keySet().stream() .anyMatch(token::equalsIgnoreCase); }  @Nonnull @Override Map<String, List<Location>> references(@Nonnull MyDocumentModel document); @Nonnull @Override Map<String, List<Location>> definitions(@Nonnull MyDocumentModel document); @Override boolean containsToken(@Nonnull MyDocumentModel document, @Nonnull String token);  }### Answer:
@Test void containsToken() { assertTrue(provider.containsToken(MODEL, "non-expected")); }
@Test void notContainsToken() { assertFalse(provider.containsToken(MODEL, "abc")); }