It is highly recommended not to use wildcard types as return types. Because the type inference rules are fairly complex it is
unlikely the user of that API will know how to use it correctly.
Let’s take the example of method returning a "List<? extends Animal>". Is it possible on this list to add a Dog, a Cat, … we simply don’t
know. And neither does the compiler, which is why it will not allow such a direct use. The use of wildcard types should be limited to method
parameters.
This rule raises an issue when a method returns a wildcard type.
Noncompliant Code Example
List<? extends Animal> getAnimals(){...}
Compliant Solution
List<Animal> getAnimals(){...}
or
List<Dog> getAnimals(){...}