class Test { enum FooBar {Foo, Bar} void someMethod() { new Infer<>((FooBar) null, FooBar.class); new Infer( (FooBar) null, FooBar.class ); } public class Infer> { @SafeVarargs public Infer(T inst, Class tClass, T... excludes) { } @SafeVarargs public Infer(String inst, Class tClass, T... excludes) { } } }