docs: public static <E> E checkInstanceOf(Class<E> type, Object object, String errorMessage) {
          isNotNull(type, "type");
          if (!type.isInstance(object)) {
              throw new IllegalArgumentException(errorMessage);
          }
          return (E) object;
      }