ArrayUtil { public static <T> Object[] toArray(T[] array) { if (array == null || array.length < 1) { return new Object[0]; } Object[] result = new Object[array.length]; System.arraycopy(array, 0, result, 0, result.length); return result; } private  ArrayUtil(); static String join(Object[] objects, String flag); static String join(String[] objects, String flag); static Object[] toArray(T[] array); static Integer[] parseIntArray(String s);  }
@Test public void testToArray_null() { Assert.assertEquals(ArrayUtil.toArray(null), new Object[0]); }
@Test public void testToArray_emptyList() { Assert.assertEquals(ArrayUtil.toArray(new String[0]), new Object[0]); }