Strings { @Deprecated public static String join(String delimiter, String... parts) { if (delimiter == null) { throw new IllegalArgumentException("First argument can't be null."); } StringBuilder sb = new StringBuilder(); for (String alias : parts) { if (sb.length() != 0) { sb.append(delimiter); } sb.append(alias); } return sb.toString(); } 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(expectedExceptions = IllegalArgumentException.class) public void testJoinShouldThrowIllegalArgumentExceptionIfDelimiterIsNull() { assertEquals(Strings.join(null, "1", "2"), ""); }
@Test public void testJoin() { assertEquals(Strings.join(",", "1", "2"), "1,2"); assertEquals(Strings.join("1", "1", "1"), "111"); assertEquals(Strings.join(",", "2"), "2"); assertEquals(Strings.join(","), ""); }