### Question:
SearchTool extends AbstractAuthBasedThriftServiceClient { protected static List<String> getTerms(String query) { Pattern pattern = Pattern.compile("\\\"" + WORD_WITH_SPACE + "+\\\"|" + WORD + "+"); Matcher matcher = pattern.matcher(query); List<String> terms = new ArrayList<>(); while (matcher.find()) { String group = matcher.group(); group = group.replaceAll("\"", ""); terms.add(group); } return terms; } 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 testGetTerms() throws TTransportException { String q1 = "red blue green"; List<String> terms = SearchTool.getTerms(q1); assertEquals("red", terms.get(0)); assertEquals("blue", terms.get(1)); assertEquals("green", terms.get(2)); String q2 = "yellow \"red blue\" green"; terms = SearchTool.getTerms(q2); assertEquals("yellow", terms.get(0)); assertEquals("red blue", terms.get(1)); assertEquals("green", terms.get(2)); String q3 = "电脑坏了 他的大脑仍然很活跃"; terms = SearchTool.getTerms(q3); assertEquals("电脑坏了", terms.get(0)); assertEquals("他的大脑仍然很活跃", terms.get(1)); String q4 = "\"" + "السلام عليكم" + "\"" + "بالتوفيق"; terms = SearchTool.getTerms(q4); assertEquals(2, terms.size()); assertEquals("السلام عليكم", terms.get(0)); assertEquals("بالتوفيق", terms.get(1)); }