@Test public void testShortenListOfLongString() { String s1 = StringUtils.repeat("t1", ShortString.MAX_LENGTH); String s2 = StringUtils.repeat("t2", ShortString.MAX_LENGTH); List<String> longStrings = ImmutableList.of(s1, s2); List<String> shortStrings = ShortString.shorten(longStrings); assertThat(shortStrings.size()).isEqualTo(longStrings.size()); for (String shortString: shortStrings) { assertThat(shortString.length()).isEqualTo(ShortString.MAX_LENGTH); } }
public static String shorten(String s) { return shorten(s, MAX_LENGTH); }
ShortString { public static String shorten(String s) { return shorten(s, MAX_LENGTH); } }
ShortString { public static String shorten(String s) { return shorten(s, MAX_LENGTH); } @SuppressWarnings("unused") private  ShortString(); }
ShortString { public static String shorten(String s) { return shorten(s, MAX_LENGTH); } @SuppressWarnings("unused") private  ShortString(); static String shorten(String s); static String shorten(String s, int maxLength); static List<String> shorten(List<String> strings); static List<String> shorten(List<String> strings, int maxLength); }
ShortString { public static String shorten(String s) { return shorten(s, MAX_LENGTH); } @SuppressWarnings("unused") private  ShortString(); static String shorten(String s); static String shorten(String s, int maxLength); static List<String> shorten(List<String> strings); static List<String> shorten(List<String> strings, int maxLength);  }