I think what you need is
public void consumeViolations(Set<? extends ConstraintViolation<?>> violations) {}
or like
public <T, V extends ConstraintViolation<T>> void consumeViolations(Set<V> violations) {}
depending on what you need to do with the Set inside the method.
This is just regular behavior of generics which are not normally covariant. You may know that a List<Dog>
is not a List<Animal>
and the same thing applies here.