ArrayUtil { public static boolean isEmpty(Collection<?> collection) { return collection == null || collection.size() == 0; }  static boolean isEmpty(Collection<?> collection); static boolean isEmpty(Object[] array); static String[] listToArray(List<String> list);  }
@Test public void testIsEmpty() { Assert.assertEquals(true, ArrayUtil.isEmpty((Collection<?>) null)); Assert.assertEquals(true, ArrayUtil.isEmpty(Collections.emptyList())); Assert.assertEquals(true, ArrayUtil.isEmpty((Object[]) null)); Assert.assertEquals(true, ArrayUtil.isEmpty(new String[] {})); Assert.assertEquals(false, ArrayUtil.isEmpty(Arrays.asList("1", "2"))); Assert.assertEquals(false, ArrayUtil.isEmpty(new String[] { "1", "3" })); }