### Question:
SPARQLQueryBuilder implements SPARQLQuery, SPARQLQueryPrimaryConditions, SPARQLQueryOptionalElements { public static String sanitizeQueryStringForFTS(String aQuery) { return aQuery .replaceAll("[\\p{Punct}\\p{Space}\\p{Cntrl}[~+*(){}\\[\\]]]+", " ") .replaceAll("[\\u00AD]", "") .trim(); } private  SPARQLQueryBuilder(KnowledgeBase aKB, Mode aMode); static SPARQLQueryPrimaryConditions forItems(KnowledgeBase aKB); static SPARQLQueryPrimaryConditions forClasses(KnowledgeBase aKB); static SPARQLQueryPrimaryConditions forInstances(KnowledgeBase aKB); static SPARQLQueryPrimaryConditions forProperties(KnowledgeBase aKB); @Override SPARQLQueryOptionalElements includeInferred(); @Override SPARQLQueryOptionalElements excludeInferred(); @Override SPARQLQueryOptionalElements includeInferred(boolean aEnabled); @Override SPARQLQueryOptionalElements limit(int aLimit); @Override SPARQLQueryOptionalElements caseSensitive(); @Override SPARQLQueryOptionalElements caseSensitive(boolean aEnabled); @Override SPARQLQueryOptionalElements caseInsensitive(); @Override SPARQLQueryPrimaryConditions withIdentifier(String... aIdentifiers); @Override SPARQLQueryPrimaryConditions matchingDomain(String aIdentifier); @Override SPARQLQueryBuilder withLabelMatchingExactlyAnyOf(String... aValues); @Override SPARQLQueryBuilder withLabelMatchingAnyOf(String... aValues); @Override SPARQLQueryBuilder withLabelContainingAnyOf(String... aValues); @Override SPARQLQueryBuilder withLabelStartingWith(String aPrefixQuery); @Override SPARQLQueryPrimaryConditions roots(); @Override SPARQLQueryPrimaryConditions ancestorsOf(String aItemIri); @Override SPARQLQueryPrimaryConditions descendantsOf(String aClassIri); @Override SPARQLQueryPrimaryConditions childrenOf(String aClassIri); @Override SPARQLQueryPrimaryConditions parentsOf(String aClassIri); @Override SPARQLQueryOptionalElements retrieveLabel(); @Override SPARQLQueryOptionalElements retrieveDescription(); @Override SPARQLQueryOptionalElements retrieveDomainAndRange(); @Override SelectQuery selectQuery(); @Override List<KBHandle> asHandles(RepositoryConnection aConnection, boolean aAll); @Override boolean exists(RepositoryConnection aConnection, boolean aAll); @Override Optional<KBHandle> asHandle(RepositoryConnection aConnection, boolean aAll); static String sanitizeQueryString(String aQuery); static String sanitizeQueryStringForFTS(String aQuery); static String convertToFuzzyMatchingQuery(String aQuery); @Override boolean equals(final Object other); @Override int hashCode(); static final int DEFAULT_LIMIT; static final String VAR_SUBJECT_NAME; static final String VAR_PREDICATE_NAME; static final String VAR_OBJECT_NAME; static final String VAR_LABEL_PROPERTY_NAME; static final String VAR_LABEL_NAME; static final String VAR_LABEL_CANDIDATE_NAME; static final String VAR_DESCRIPTION_NAME; static final String VAR_DESCRIPTION_CANDIDATE_NAME; static final String VAR_RANGE_NAME; static final String VAR_DOMAIN_NAME; static final Variable VAR_SUBJECT; static final Variable VAR_PREDICATE; static final Variable VAR_OBJECT; static final Variable VAR_RANGE; static final Variable VAR_DOMAIN; static final Variable VAR_LABEL; static final Variable VAR_LABEL_CANDIDATE; static final Variable VAR_LABEL_PROPERTY; static final Variable VAR_DESCRIPTION; static final Variable VAR_DESC_CANDIDATE; static final Prefix PREFIX_LUCENE_SEARCH; static final Iri LUCENE_QUERY; static final Iri LUCENE_PROPERTY; static final Iri LUCENE_SCORE; static final Iri LUCENE_SNIPPET; static final Prefix PREFIX_FUSEKI_SEARCH; static final Iri FUSEKI_QUERY; static final Iri OWL_INTERSECTIONOF; static final Iri RDF_REST; static final Iri RDF_FIRST; }### Answer:
@Test public void thatLineBreaksAreSanitized() throws Exception { assertThat(sanitizeQueryStringForFTS("Green\n\rGoblin")) .isEqualTo("Green Goblin"); }