How to use ? extends in Generics?