### Question:
PrimitiveLongCollections { public static long[] deduplicate( long[] values ) { if ( values.length < 2 ) { return values; } long lastValue = values[0]; int uniqueIndex = 1; for ( int i = 1; i < values.length; i++ ) { long currentValue = values[i]; if ( currentValue != lastValue ) { values[uniqueIndex] = currentValue; lastValue = currentValue; uniqueIndex++; } } return uniqueIndex < values.length ? Arrays.copyOf( values, uniqueIndex ) : values; } private  PrimitiveLongCollections(); static LongIterator iterator( final long... items ); static LongIterator concat( LongIterator... longIterators ); static LongIterator concat( Iterable<LongIterator> primitiveLongIterators ); static LongIterator filter( LongIterator source, final LongPredicate filter ); static LongIterator range( long start, long end ); static int indexOf( LongIterator iterator, long item ); static MutableLongSet asSet( Collection<Long> collection ); static MutableLongSet asSet( LongIterator iterator ); static int count( LongIterator iterator ); static long[] asArray( LongIterator iterator ); static long[] asArray( Iterator<Long> iterator ); static LongIterator toPrimitiveIterator( final Iterator<Long> iterator ); static Iterator<T> map( final LongFunction<T> mapFunction, final LongIterator source ); static List<Long> asList( LongIterator iterator ); static Iterator<Long> toIterator( final LongIterator primIterator ); static PrimitiveLongResourceIterator resourceIterator( final LongIterator iterator,
            final Resource resource ); static Set<Long> toSet( LongSet set ); static Set<Long> toSet( LongIterator iterator ); static long[] deduplicate( long[] values ); static MutableLongSet mergeToSet( LongIterable a, LongIterable b ); 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 ); }