code: public static boolean isBoolean(TypeRef type) {
          if (type instanceof PrimitiveRef) {
              return Constants.PRIMITIVE_BOOLEAN_REF.equals(type);
          } else if (!(type instanceof ClassRef)) {
              return false;
          } else {
              return Constants.BOOLEAN_REF.equals(type);
          }
      }
docs: Checks if a {@link TypeRef} is a {@link Boolean} or boolean.
  @param type  The type to check.
  @return      True if its a {@link Boolean} or boolean.