Fix Mac OS X stub java workaround

* Fixes https://tickets.opscode.com/browse/OHAI-514
* I've tested manually on a mac w/o any JDK/JRE present, could use a sanity check on a system that has a JRE/JDK
* Refactor Java plugin tests to use shared example groups so no duplication is needed when testing the Mac/Not-Mac case.