class InputValidationUtils {

  @VisibleForTesting
  @Nonnull
  static InputValidationNotes validateSourceLocation(
      String query, CompletionMetadata completionMetadata) {
    Validity validity =
        autoCompleteSourceLocation(query, completionMetadata).stream()
                .anyMatch(suggestion -> suggestion.getText().equals(query))
            ? Validity.VALID
            : Validity.INVALID;
    return new InputValidationNotes(validity, ImmutableList.of());
  }

}