How to EasyMock a call to a method that returns a wildcarded generic?
I've run into a problem like this before, with Mockito. I'm not sure why it happens yet. You can cast the expect(..) argument to the non-generic Class type, ala
expect((Class) mockBeanFactory.getType(CLASS_NAME)).andReturn(SOME_CLASS);
Then you'll just have a warning, which you can suppress if you want. Not a very elegant solution; I'm going to spend a few more minutes looking at it.