### Question:
PrimitiveIntCollections { public static int[] deduplicate(int[] values) { int unique = 0; for (int i = 0; i < values.length; i++) { int 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  PrimitiveIntCollections(); static PrimitiveIntIterator iterator(final int... items); static PrimitiveIntIterator concat(Iterator<PrimitiveIntIterator> iterators); static PrimitiveIntIterator filter(PrimitiveIntIterator source, final IntPredicate filter); static long[] asLongArray(PrimitiveIntCollection values); static PrimitiveIntIterator emptyIterator(); static PrimitiveIntIterator toPrimitiveIterator(final Iterator<Integer> iterator); static Iterator<T> map(final IntFunction<T> mapFunction, final PrimitiveIntIterator source); static void consume(PrimitiveIntIterator source, IntConsumer consumer); static boolean contains(int[] values, int candidate); static List<Integer> toList(PrimitiveIntIterator iterator); static Set<Integer> toSet(PrimitiveIntIterator iterator); static Set<T> mapToSet(PrimitiveIntIterator iterator, IntFunction<T> map); static int[] deduplicate(int[] values);  }### Answer:
@Test void shouldDeduplicate() { int[] array = new int[]{1, 6, 2, 5, 6, 1, 6}; int[] deduped = PrimitiveIntCollections.deduplicate(array); assertArrayEquals(new int[]{1, 6, 2, 5}, deduped); }