code: public final T check(Object object, T defaultValue) {
          try {
              return check(object);
          } catch (ClassCastException e) {
              return defaultValue;
          }
      }
docs: Checks and casts an object to the specified type. If casting fails, a default value is returned.
  
  @param object The object to be checked
  @param defaultValue The default value to be returned if casting fails
  @return The same object, cast to the specified class, or the default value, if casting fails