### Question:
PrimitiveLongCollections { public static long[] asArray(PrimitiveLongIterator iterator) { long[] array = new long[8]; int i = 0; for (; iterator.hasNext(); i++) { if (i >= array.length) { array = copyOf(array, i << 1); } array[i] = iterator.next(); } if (i < array.length) { array = copyOf(array, i); } return array; } private  PrimitiveLongCollections(); static PrimitiveLongIterator iterator(final long... items); static PrimitiveLongIterator concat(PrimitiveLongIterator... primitiveLongIterators); static PrimitiveLongIterator concat(Iterable<PrimitiveLongIterator> primitiveLongIterators); static PrimitiveLongIterator filter(PrimitiveLongIterator source, final LongPredicate filter); static PrimitiveLongResourceIterator filter(
        PrimitiveLongResourceIterator source,
        final LongPredicate filter
    ); static PrimitiveLongIterator range(long start, long end); static long single(PrimitiveLongIterator iterator, long defaultItem); static int indexOf(PrimitiveLongIterator iterator, long item); static int count(PrimitiveLongIterator iterator); static long[] asArray(PrimitiveLongIterator iterator); static long[] asArray(Iterator<Long> iterator); static PrimitiveLongIterator emptyIterator(); static PrimitiveLongIterator toPrimitiveIterator(final Iterator<Long> iterator); static Iterator<T> map(final LongFunction<T> mapFunction, final PrimitiveLongIterator source); static List<Long> asList(PrimitiveLongIterator iterator); static Iterator<Long> toIterator(final PrimitiveLongIterator primIterator); static PrimitiveLongResourceIterator resourceIterator(
        final PrimitiveLongIterator iterator,
        final Resource resource
    ); static Set<Long> toSet(PrimitiveLongSet set); static Set<Long> toSet(PrimitiveLongIterator iterator); static long[] deduplicate(long[] values); static final long[] EMPTY_LONG_ARRAY; }### Answer:
@Test void asArray() { PrimitiveLongIterator items = PrimitiveLongCollections.iterator(1, 2, 3); long[] array = PrimitiveLongCollections.asArray(items); assertTrue(Arrays.equals(new long[]{1, 2, 3}, array)); }