AutoFactory to generate non-final factory classes, to allow mocking with Mockito.