### Question:
SearchMultiplePattern { public String query(String text) { return null; } SearchMultiplePattern(List<String> patterns); String query(String text);  }### Answer:
@Test public void basicTest() { SearchMultiplePattern search = new SearchMultiplePattern(Arrays.asList("abc", "def", "app", "cat")); Assert.assertEquals("abc", search.query("fhasjkfhabcqwe")); Assert.assertEquals("def", search.query("fhadefghabcqwe")); Assert.assertEquals("app", search.query("fhappfashabcqwe")); Assert.assertEquals("cat", search.query("fhasjkfhabqwecat")); }