code: public static boolean hasInstanceOf(final JSONObject json, final String key,
                                          Class<?> type) {
          Object o = json.opt(key);
          return isInstanceOf(o, type);
      }
docs: Check if the {@link JSONObject} has an item at {@code key} that is an
  instance of {@code type}.
  
  @param json {@code JSONObject} to inspect
  @param key  Item in object to check
  @param type Type to check the item against
  @return {@code True} if the item exists and is of the specified
  {@code type}; {@code false} otherwise