@Test public void testNullToEmptyIntegers() { final Integer[] array = new Integer[] {1, 2, 3}; Assert.assertArrayEquals("Must return the same array", array, CollectionUtils.nullToEmpty(array)); Assert.assertTrue("Must return reference to the same object", array == CollectionUtils.nullToEmpty(array)); }
@SuppressWarnings("unchecked") public static <T> T[] nullToEmpty(final T[] array) { return array == null ? (T[])EMPTY_ARRAY : array; }
CollectionUtils { @SuppressWarnings("unchecked") public static <T> T[] nullToEmpty(final T[] array) { return array == null ? (T[])EMPTY_ARRAY : array; } }
CollectionUtils { @SuppressWarnings("unchecked") public static <T> T[] nullToEmpty(final T[] array) { return array == null ? (T[])EMPTY_ARRAY : array; } private  CollectionUtils(); }
CollectionUtils { @SuppressWarnings("unchecked") public static <T> T[] nullToEmpty(final T[] array) { return array == null ? (T[])EMPTY_ARRAY : array; } private  CollectionUtils(); static boolean isEmpty(final Collection<T> parameter); static boolean isNotEmpty(final Collection<T> parameter); @SuppressWarnings("unchecked") static T[] nullToEmpty(final T[] array); }
CollectionUtils { @SuppressWarnings("unchecked") public static <T> T[] nullToEmpty(final T[] array) { return array == null ? (T[])EMPTY_ARRAY : array; } private  CollectionUtils(); static boolean isEmpty(final Collection<T> parameter); static boolean isNotEmpty(final Collection<T> parameter); @SuppressWarnings("unchecked") static T[] nullToEmpty(final T[] array);  }