Java thenComparing wildcard signature
问题 Why does the declaration look like this: default <U extends Comparable<? super U>> Comparator<T> thenComparing( Function<? super T, ? extends U> keyExtractor) I understand most of it. It makes sense that U can be anything as long as it's comparable to a superclass of itself, and thus also comparable to itself. But I don't get this part: Function<? super T, ? extends U> Why not just have: Function<? super T, U> Can't the U just parameterize to whatever the keyExtractor returns, and still