code: protected static IllegalArgumentException invalidType(
        String view, String attribute, Object value, Class<?>... expectedTypes) {
      Object expected =
          expectedTypes.length == 1 ? expectedTypes[0] : "one of " + Arrays.toString(expectedTypes);
      throw new IllegalArgumentException(
          "invalid type "
              + value.getClass()
              + " for attribute '"
              + view
              + ":"
              + attribute
              + "': expected "
              + expected);
    }
docs: Throws an illegal argument exception indicating that the given value is not one of the expected
  types for the given attribute.