code: public JSType createOptionalType(JSType type) {
      if (type instanceof UnknownType || type.isAllType()) {
        return type;
      } else {
        return createUnionType(type, getNativeType(JSTypeNative.VOID_TYPE));
      }
    }
docs: Creates a type representing optional values of the given type.
  @return the union of the type and the void type