Added test using JUnit Contrib Theories. Used a generator class to return mock instances of a class or null