The first <T> is the actual declaration of the type parameter, that is, it says that the method is general and has a parameter of type T
The second <T> is just part of the return type of the method, that is, the method returns a Provider<T> .
If the first <T> was omitted, the return type Provider<T> would be invalid, as T would not be a recognized identifier / name for the type. T recognized only as a type because the first <T> represents it as such.
source share