### Question:
Functions { public static String keyMatch(Object map, String pattern) { if (map instanceof Map) { Pattern p = null; try { p = Pattern.compile(pattern); } catch (PatternSyntaxException pse) { return null; } for (Object key : ((Map<?, ?>) map).keySet()) { if (key instanceof String && p.matcher((String) key).matches()) { return (String) key; } } } 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 public void keyMatch() throws ExpressionException { attributes.put("bjensen", "Barbara Jensen"); attributes.put("bmaddox", "Barbara Maddox"); String o = Expression.valueOf("${attributes[keyMatch(attributes, '^bjense.*')]}", String.class).eval(bindings); assertThat(o).isEqualTo(attributes.get("bjensen")); }