code: public static boolean isPrimitive(Class<?> type) {
          return type == Class.class || type == String.class
              || type == Character.class || type == Character.TYPE
              || type == Boolean.class || type == Boolean.TYPE
              || type == Byte.class || type == Byte.TYPE
              || type == Short.class || type == Short.TYPE
              || type == Integer.class || type == Integer.TYPE
              || type == Long.class || type == Long.TYPE
              || type == Float.class || type == Float.TYPE
              || type == Double.class || type == Double.TYPE
              || type == Void.TYPE;
      }
docs: Tests whether a class is a primitive type. Different from Class.isPrimitive, this method consider
  the following also as "primitive types".
  <ul>
  <li>Wrapper classes of the primitive types
  <li>Class
  <li>String
  </ul>
  
  @param type the type to test
  @return whether the type is primitive