This produces an unchecked warning: ```java Class<T> clazz = ...; if (clazz.isInstance(obj)) { return (T) obj; } ``` I guess the solution would be to replace `(T) obj` with `clazz.cast(obj)` but a method returning `Optional<T>` would be quite elegant
This produces an unchecked warning:
I guess the solution would be to replace
(T) objwithclazz.cast(obj)but a method returningOptional<T>would be quite elegant