### Question:
Functions { public static String[] matchingGroups(String value, String pattern) { try { Pattern p = Pattern.compile(pattern); Matcher m = p.matcher(value); if (m.find()) { int count = m.groupCount(); String[] matches = new String[count + 1]; matches[0] = m.group(0); for (int n = 1; n <= count; n++) { matches[n] = m.group(n); } return matches; } } catch (PatternSyntaxException pse) { } return null; } private  Functions(); static String[] array(String... values); static boolean contains(Object object, Object value); static int indexOf(String value, String substring); static String join(String[] values, String separator); static String keyMatch(Object map, String pattern); static int length(Object value); static boolean matches(String value, String pattern); static String[] matchingGroups(String value, String pattern); static String[] split(String value, String regex); static String toLowerCase(String value); static String toString(Object value); static String toUpperCase(String value); static String trim(String value); static String urlEncode(String value); static String urlDecode(String value); static String encodeBase64(final String value); static String decodeBase64(final String value); static String read(final String filename); static Properties readProperties(final String filename);  }### Answer:
@Test(dataProvider = "matchData") public void matchingGroups(String s, String pattern, boolean matches, String[] groups) throws Exception { attributes.put("s", s); Expression<String[]> stringArrayExpr = Expression.valueOf("${matchingGroups(attributes.s, " + "'" + pattern + "')}", String[].class); String[] o = stringArrayExpr.eval(bindings); if (matches) { assertThat(o).isInstanceOf(String[].class); String[] ss = o; assertThat(ss).isEqualTo(groups); } else { assertThat(o).isNull(); } }