@Test public void testToPrimitive() { Assert.assertArrayEquals(ArrayUtils.toPrimitive(null), null); Assert.assertArrayEquals(ArrayUtils.toPrimitive(new Long[0]), new long[0]); Assert.assertArrayEquals( ArrayUtils.toPrimitive(new Long[]{ 1L, 1763L, 54769975464L }), new long[]{ 1L, 1763L, 54769975464L }); thrown.expect(NullPointerException.class); Assert.assertArrayEquals(ArrayUtils.toPrimitive(new Long[]{null}), new long[]{1L}); }
public static long[] toPrimitive(final Long[] array) { if (array == null) { return null; } else if (array.length == 0) { return EMPTY_LONG_ARRAY; } final long[] result = new long[array.length]; for (int i = 0; i < array.length; i++) { result[i] = array[i].longValue(); } return result; }
ArrayUtils { public static long[] toPrimitive(final Long[] array) { if (array == null) { return null; } else if (array.length == 0) { return EMPTY_LONG_ARRAY; } final long[] result = new long[array.length]; for (int i = 0; i < array.length; i++) { result[i] = array[i].longValue(); } return result; } }
ArrayUtils { public static long[] toPrimitive(final Long[] array) { if (array == null) { return null; } else if (array.length == 0) { return EMPTY_LONG_ARRAY; } final long[] result = new long[array.length]; for (int i = 0; i < array.length; i++) { result[i] = array[i].longValue(); } return result; }  }
ArrayUtils { public static long[] toPrimitive(final Long[] array) { if (array == null) { return null; } else if (array.length == 0) { return EMPTY_LONG_ARRAY; } final long[] result = new long[array.length]; for (int i = 0; i < array.length; i++) { result[i] = array[i].longValue(); } return result; }  static long[] toPrimitive(final Long[] array); }
ArrayUtils { public static long[] toPrimitive(final Long[] array) { if (array == null) { return null; } else if (array.length == 0) { return EMPTY_LONG_ARRAY; } final long[] result = new long[array.length]; for (int i = 0; i < array.length; i++) { result[i] = array[i].longValue(); } return result; }  static long[] toPrimitive(final Long[] array); static final long[] EMPTY_LONG_ARRAY; }