KouInject is a free and open source dependency injection framework. In short, dependency injection removes the responsibility of creating instances of classes from other classes.
KouInject will create the instances and make sure they are available where needed. This will make it easy to test the class. Any dependencies can then be easily mocked so they don't interfere with the test of the actual algorithm in the method.
NOTE: The user guide is available HERE.
Here are some key features of "KouInject":
· Annotations instead of XML
· Injection in constructors, fields and methods
· Java 1.6 or later