Can this method return true somehow?
public static boolean isVoid(T t)
{
return t instanceof Void;
}
No. To make it return true you have to call it and pass an argument of type Void. But the constructor of class Void is private, so you cannot call it. Moreover, this class is final, so you cannot even extend it. Thus you cannot create an instance of class Void. But it is needed to make your method to return true.
BTW: If you really want to do it, call the constructor of Void by reflection. But I can think about this as a system abuse exercise. Good luck.