### Question:
SparqlQueryUtils { protected static String createFullTextQueryString(Collection<String> constraints) { StringBuilder textQuery = new StringBuilder(); boolean firstText = true; for (String constraintText : constraints) { if (constraintText != null && !constraintText.isEmpty()) { if (firstText) { firstText = false; } else { textQuery.append(" OR "); } String[] words = constraintText.split("\\W+"); if (words.length > 1) { textQuery.append('('); } boolean firstAndWord = true; for (String word : words) { word = word.trim(); boolean hasAlphaNumeric = false; for (int i = 0; i < word.length() && !hasAlphaNumeric; i++) { char ch = word.charAt(i); if (Character.isLetter(ch) || Character.isDigit(ch)) { hasAlphaNumeric = true; } } if (hasAlphaNumeric) { if (firstAndWord) { firstAndWord = false; } else { textQuery.append(" AND "); } textQuery.append('"'); textQuery.append(word); textQuery.append('"'); } } if (words.length > 1) { textQuery.append(')'); } } } return textQuery.toString(); } private  SparqlQueryUtils(); static String createSparqlConstructQuery(SparqlFieldQuery query,
                                                    SparqlEndpointTypeEnum endpointType,
                                                    String... additionalFields); static String createSparqlConstructQuery(SparqlFieldQuery query,
                                                    int limit,
                                                    SparqlEndpointTypeEnum endpointType,
                                                    String... additionalFields); static String createSparqlSelectQuery(SparqlFieldQuery query, SparqlEndpointTypeEnum endpointType); static String createSparqlSelectQuery(SparqlFieldQuery query,
                                                 int limit,
                                                 SparqlEndpointTypeEnum endpointType); static String createSparqlSelectQuery(SparqlFieldQuery query,
                                                 boolean includeFields,
                                                 SparqlEndpointTypeEnum endpointType); static String createSparqlSelectQuery(SparqlFieldQuery query,
                                                 boolean includeFields,
                                                 int limit,
                                                 SparqlEndpointTypeEnum endpointType); static String guessXsdType(Class<?> javaClass); static void main(String[] args);  }### Answer:
@Test public void testCreateFullTextQueryString() { List<String> keywords = Arrays.asList("test", "keyword"); assertEquals("\"test\" OR \"keyword\"", SparqlQueryUtils.createFullTextQueryString(keywords)); keywords = Arrays.asList("test keyword"); assertEquals("(\"test\" AND \"keyword\")", SparqlQueryUtils.createFullTextQueryString(keywords)); keywords = Arrays.asList("'test' \"keyword\""); assertEquals("(\"test\" AND \"keyword\")", SparqlQueryUtils.createFullTextQueryString(keywords)); keywords = Arrays.asList("1 Alpha ? Numeric Test ."); assertEquals("(\"1\" AND \"Alpha\" AND \"Numeric\" AND \"Test\")", SparqlQueryUtils.createFullTextQueryString(keywords)); }