Strings { public static String abbreviateFqClassName(String fqcn) { return fqcn.replaceAll(FQ_CLASS_NAME, "$1"); } private  Strings(); static String abbreviate(String str, int offset, int maxWidth); static String abbreviateMiddle(String string, int maxLength); static String abbreviateFqClassName(String fqcn); static String capitalize(String str); static String substringAfterLast(String str, String separator); static String strip(String str, String stripChars); static String stripStart(String str, String stripChars); static String stripEnd(String str, String stripChars); static String getParent(String path); static String getDomain(String url); static String sanitize(String str);  }
@Test public void abbreviateFqClassname() throws Exception { assertEquals("c.a.main", Strings.abbreviateFqClassName("com.acme.main")); assertEquals("c.a.main.Main", Strings.abbreviateFqClassName("com.acme.main.Main")); assertEquals("c.a.l.p.foo.Bar", Strings.abbreviateFqClassName("com.acme.longer.package.foo.Bar")); }