Actually there is a pragmatic case where void.class is really useful.
Suppose you need to create an annotation for class fields, and you need to define the class of the field to get some information about it (in example, if the field is an enum, to get list of potential values). In that case, you would need something like this:
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface PropertyResourceMapper
{
public Class acceptedValues() default void.class;
}
to be used like this:
@PropertyResourceMapper(acceptedValues = ImageFormat.class, description = "The format of the image (en example, jpg).")
private ImageFormat format;
I have used this to create a custom serializer of classes to a proprietary format.