### Question:
SearchTool extends AbstractAuthBasedThriftServiceClient { protected static Output getQuestions(String query) { Matcher matcher = PATTERN.matcher(query); List<String> questions = new ArrayList<>(); while (matcher.find()) { String group = matcher.group(); query = query.replaceFirst(Pattern.quote(group), ""); group = group.replaceAll("^\\?", "").replaceAll("[:\\\"]", ""); questions.add(group); } query = query.trim(); return new Output(query, questions); } SearchTool();  SearchTool(Config cfg);  SearchTool(ConcreteServicesSearchConfig cfg);  SearchTool(String host, int port, String auths);  SearchTool(String host, int port, Optional<String> auths); SearchResult search(String query, SearchType type); @Override void close(); static void main(String[] args);  }### Answer:
@Test public void testGetQuestions() throws TTransportException { String q1 = "?:What is blue? ?:What is green?"; Output output = SearchTool.getQuestions(q1); assertEquals("What is blue?", output.items.get(0)); assertEquals("What is green?", output.items.get(1)); assertEquals("", output.query); String q2 = "colors ?:\"What is red?\" ?:What is green?"; output = SearchTool.getQuestions(q2); assertEquals("What is red?", output.items.get(0)); assertEquals("What is green?", output.items.get(1)); assertEquals("colors", output.query); String q3 = "colors ?:\"What is red\" ?:\"What is green?\" test"; output = SearchTool.getQuestions(q3); assertEquals("What is red", output.items.get(0)); assertEquals("What is green?", output.items.get(1)); assertEquals("colors test", output.query); }