Text { public static String removeLast(String s) { if (Strings.isNullOrEmpty(s)) return s; return s.substring(0, s.length() - 1); }  static String removeLast(String s); static String generateHash(String key); static String capitalize(String s); static String matchMax(String left, String right); static boolean containsEvilSpecialChar(String stringToCheck); static String containingString(String str, String prefix, String suffix);  }
@Test public void testRemoveLast() { assertThat(Text.removeLast(null), is(nullValue())); assertThat(Text.removeLast(""), is("")); assertThat(Text.removeLast("a"), is("")); assertThat(Text.removeLast("abcdef"), is("abcde")); }