I think the code (java.getClass() == java.lang.Boolean.class) is a bit faster, because it really only checks for a comparison. The instanceof operator traverses the hierarchy metadata in the class object.

Since all these classes are final, this check should be absolutely equivalent.