Was the Reflection API that difficult?

Yes, easy to forget its low-level minutia. Anyway, you create more value writing code specific to your application domain, rather than plumbing with the compiler.
Oracle describes common problems encountered using the Reflection API in troubleshooting sections of its tutorials: Fields, Methods, Constructors.


How else can I test private members in Java?

From Artima developer:
  • Don't test private methods.
  • Give the methods package access.
  • Use a nested test class.
  • Use reflection.

Explain, what's going on?

dp4j analyses method blocks annotated with JUnit/TestNG @Test annotations and just before the compiler generates the bytecode for the tests it replaces every privileged access with the equivalent Java Reflection API calls (in the AST).
You can view the injected code with the -Averbose=true compiler option. This stackoveflow answer demonstrates.

Does it work with Eclipse?

Kinda. Eclipse use its own Java Compiler, while dp4j interacts with javac internal APIs. But if you use Maven/m2eclipse then you can specify to use the javac compiler. dp4jmaventest.zip  demonstrates. IntelliJ uses Oracle's Java Compiler, just as NetBeans does.

Does it really work?

Of course, but this is the earliest release of "release early, release often". Not all Java syntax is covered, especially the most complicated (it's not a bug, it's a feature =) ) and only the Singleton and Template Method (partially) are validated.
You shouldn't use this in production code yet, but do we consider testing code production code?
And you are welcome to contribute patches, it's an open-source project.

Do you need help?

Sure, contributions extending syntax coverage and patterns validation are welcome and duely acknowledged in this open-source project.
The quickest thing you can do is vote for this javac bug. For more visit the issues list and the Help Wanted jobs list. Oh, and if you don't find the time to code, donations will pay for it and we will all benefit from more features and fewer issues.

What other boilerplate busters are there?

  • Lombok: @Data injects getters, setters, a toString, hashcode, equals, and a constructor for the annotated class; It compromises 12 annotations;
  • Juast: Use primitive arithmetic operators (+/-*) with BigInteger/BigDecimals without even using annotations;
  • Morbok: @Logger injects private static final Log log = LogFactory.getLog("mypackage.LogTest");
  • SqlWrapper: Vendor-dependant SQL is wrapped in stmt.executeQuery(SqlWrapper.selectId(ordersTable, customerColumn, "John Smith"); 
Know of another? Announce it.