### Question:
PrimitiveLongCollections { public static long[] deduplicate( long[] values ) { int unique = 0; for ( int i = 0; i < values.length; i++ ) { long value = values[i]; for ( int j = 0; j < unique; j++ ) { if ( value == values[j] ) { value = -1; break; } } if ( value != -1 ) { values[unique++] = values[i]; } } return unique < values.length ? Arrays.copyOf( values, unique ) : values; } 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 PrimitiveLongSet asSet( Collection<Long> collection ); static PrimitiveLongSet asSet( PrimitiveLongIterator iterator ); static PrimitiveLongSet asSet( PrimitiveLongSet set ); static PrimitiveLongSet asSet( long... values ); static PrimitiveLongObjectMap<T> copy( PrimitiveLongObjectMap<T> original ); 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 PrimitiveLongSet emptySet(); static PrimitiveLongSet setOf( long... values ); 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 shouldDeduplicate() { long[] array = new long[]{1L, 1L, 2L, 5L, 6L, 6L}; long[] deduped = PrimitiveLongCollections.deduplicate( array ); assertArrayEquals( new long[]{1L, 2L, 5L, 6L}, deduped ); }