Str { public static String group(String text, String regexp) { return group(text, regexp, 1); }  static String trim(String s); static String group(String text, String regexp); static String group(String text, String regexp, int group); static Pair<String, String> groups(String text, String regexp, int group1, int group2); static boolean containsSpaces(String ... strings); static String lower(String s); static String upper(String s);  }
@Test public void group() { assertNull("asdf : a -> null", Str.group("asdf", "a")); assertNull("asdf : q -> null", Str.group("asdf", "q")); assertEquals("asdf : (s) -> s", Str.group("asdf", "(s)"), "s"); assertEquals("asdf : ^.(..) -> sd", Str.group("asdf", "^.(..)"), "sd"); assertNull("asdf : ^.{5}(.+) -> null", Str.group("asdf", "^.{5}(.+)")); }