Fixed issue #30

Added an extra conditional to prevent using MockProvider if it's an inner class, and added a test to verify that the new version works correctly. This fixes issue #30
I just saw a lot of javadoc errors on one of the builds and it was easier for me to add javadoc than to figure out which line numbers were which because I had deleted and moved stuff around.

I still haven't managed to get checkstyle to work on my local machine, so better to be safe than sorry. Feel free to modify the pull request on the way in if you like