You need to pass it (a reference to) an instance of class Class. You can get these with Object's getClass() method. Or use .class with a class literal like the parameter used with the allOf() method of EnumSet below: