StringHelper { public static String[] checkEmpty(String[] s) { return ListHelper.isEmpty(s) ? emptyArray() : s; }  static String appendSlant(String url); static byte[] getBytes(String s); static String getString(byte[] bytes); static String[] mergeArray(String[] a, String[] b); static String[] emptyArray(); static String emptyString(); static boolean isEmpty(String s); static boolean isEmpty(String[] s); static String[] checkEmpty(String[] s); static String isEmpty(String value, String defaultValue); static String[] split(String s); static List<String> splitToList(String s);  }
@Test public void checkEmpty() throws UnsupportedEncodingException { Assert.assertEquals(0, StringHelper.checkEmpty(null).length); Assert.assertEquals(0, StringHelper.checkEmpty(new String[0]).length); Assert.assertArrayEquals(new String[]{"test1","test2"}, StringHelper.checkEmpty(new String[]{"test1","test2"})); }