@SuppressWarnings("Java8CollectionRemoveIf")
        @Override
        public <T> void processDuplicates(@NonNull List<T> list) {
            Set<T> seen = new HashSet<>(list.size());
            for (ListIterator<T> it = list.listIterator(); it.hasNext(); ) {
                T next = it.next();
                if (!seen.add(next)) {
                    it.remove();
                }
            }
        }
A {@link DuplicateRemovalFunction} that retains only the first occurrence.
api/src/main/java/net/luckperms/api/metastacking/DuplicateRemovalFunction.java