code: public static boolean isBoolean( Object obj ) {
        if( (obj instanceof Boolean) || (obj != null && obj.getClass() == Boolean.TYPE) ){
           return true;
        }
        return false;
     }
docs: Tests if obj is a Boolean or primitive boolean