Strings { @Deprecated public static String longestCommonPrefix(String... input) { String prefix = ""; if (input.length > 0) { prefix = input[0]; } for (int i = 1; i < input.length; ++i) { String s = input[i]; int j = 0; for (int length = Math.min(prefix.length(), s.length()); j < length; ++j) { if (prefix.charAt(j) != s.charAt(j)) { break; } } prefix = prefix.substring(0, j); } return prefix; } private  Strings(); @Deprecated static String nullToEmpty(String string); @Deprecated static String emptyToNull(String string); @Deprecated static boolean isNullOrEmpty(String string); @Deprecated static String join(String delimiter, String... parts); @Deprecated static String[] split(String raw, char ch); @Deprecated static String longestCommonPrefix(String... input);  }
@Test public void shouldReturnEmptyStringOnEmptyParameters_longestCommonPrefix() { assertEquals("", Strings.longestCommonPrefix()); }
@Test public void shouldReturnSameStringIf1Parameter_longestCommonPrefix() { assertEquals("param", Strings.longestCommonPrefix("param")); }
@Test public void shouldReturnEmptyIfNoCommonPrefix_longestCommonPrefix() { assertEquals("", Strings.longestCommonPrefix("dff", "blafa")); }
@Test public void shouldFindCommonPrefix_longestCommonPrefix() { assertEquals("bla", Strings.longestCommonPrefix("blafoijqoweir", "blafa", "blamirfjo")); }