I have a code like this:
protected T doSomething(String someParam, Class clazz) { ... }
which I use in a TestCase class:
A workaround is using eclipse compiler in maven as described at Using Eclipse Java Compiler (ecj) in maven builds