@Override
    public void retainAll(Collection<I> ids) {
        this.objects.keySet().stream()
                .filter(g -> !ids.contains(g))
                .forEach(this::unload);
    }
An abstract manager class

@param <I> the class used to identify each object held in this manager
@param <C> the super class being managed
@param <T> the implementation class this manager is "managing"
common/src/main/java/me/lucko/luckperms/common/model/manager/AbstractManager.java