StringUtils { public static String[] split(final String input, final String regex) { if (input == null) { return null; } final String[] arr = input.split(regex); final List<String> results = new ArrayList<>(arr.length); for (final String a : arr) { if (!a.trim().isEmpty()) { results.add(a); } } return results.toArray(new String[0]); } private  StringUtils(); static String[] split(final String input, final String regex); static String printShortBuffer(final ByteBuffer buffer);  }
@Test public void testNull() { assertNull(StringUtils.split(null, ",")); }
@Test public void testFilter() { final String[] result = StringUtils.split("1, ,,", ","); assertNotNull(result); assertEquals(1, result.length); assertEquals("1", result[0]); }