StringUtil { public static String join(String split, String... args) { return join(split, (arg) -> arg, args); }  static String subHead(String str, int maxLen); static String toString(Object obj); static String randomString(int length); static String join(String split, String... args); static String join(String split, Object... args); static String join(String split, Function<T, String> function, Collection<T> args); static String join(String split, Function<T, String> function, T ... args); static boolean isEmpty(String str); static String[] splitRemoveEmpty(String regex, String str); static boolean trimEquals(String str1, String str2, boolean ignoreCase); static boolean trimEquals(String str1, String str2); static String[] splitByLen(String buff, int splitLen); static int compareVersion(String version1, String version2); static String[] splitByLineRemoveEmpty(String str);  }
@Test public void test(){ Assert.assertEquals("a,null,b,c", StringUtil.join(",", "a", null, "b", "c")); Assert.assertEquals("a,null,b,c,null", StringUtil.join(",", "a", null, "b", "c", null)); }