### Question:
FilterUtil { public static List<String> extractParameters(String filter) { List<String> result = new ArrayList<>(); Matcher matcher = PARAM_PATTERN.matcher(filter); while (matcher.find()) { String param = matcher.group(); result.add(param.substring(2)); } return result; } private  FilterUtil(); static List<String> extractParameters(String filter); static boolean hasAnyParameter(String filter); static String merge(String filter, String jsonMessage);  }### Answer:
@Test public void verifySimpleFilterInputParameterExtraction() { String filterExpression = "{test: :#test, test2: \":#someParam\", test3: /:#regexParam/}"; List<String> result = FilterUtil.extractParameters(filterExpression); Assertions.assertThat(result).containsExactly("test", "someParam", "regexParam"); }
@Test public void verifyComplexFilterInputParameterExtraction() { String filterExpression = "{ '$or' => [ {a => :#p1 }, { b => :#p2 } ] }"; List<String> result = FilterUtil.extractParameters(filterExpression); Assertions.assertThat(result).containsExactly("p1", "p2"); }