@Test public void testAbbreviate() { Abbreviation abbreviation = new Abbreviation("de.qaware", "Q"); assertThat(abbreviation.abbreviate("com.something"), is("com.something")); assertThat(abbreviation.abbreviate("de.something"), is("de.something")); assertThat(abbreviation.abbreviate("de.qaware"), is("Q")); assertThat(abbreviation.abbreviate("de.qaware.qav"), is("Q.qav")); assertThat(abbreviation.abbreviate(""), is("")); assertThat(abbreviation.abbreviate(null), nullValue()); }
public String abbreviate(String s) { if (s == null) { return null; } return s.replaceAll(pattern, replacement); }
Abbreviation { public String abbreviate(String s) { if (s == null) { return null; } return s.replaceAll(pattern, replacement); } }
Abbreviation { public String abbreviate(String s) { if (s == null) { return null; } return s.replaceAll(pattern, replacement); }  }
Abbreviation { public String abbreviate(String s) { if (s == null) { return null; } return s.replaceAll(pattern, replacement); }  String abbreviate(String s); }
Abbreviation { public String abbreviate(String s) { if (s == null) { return null; } return s.replaceAll(pattern, replacement); }  String abbreviate(String s);  }