Finding patterns and design APIs using Java generics

I use generics quite widely for working with Java and Guava collections. I understand this well when using the API:

  • PECS Rule
  • {co, contra, in} variance
  • Wildcard
  • Limited generics

However, it is difficult for me to find generic APIs. Are there design patterns for Java generics? Any links to Java generics can also help. I read:

I am familiar with only two patterns in which generics are useful:

  • Containment concept: collections of Java, Guava Optional<T>, etc.
  • Type parameterization: Guava Predicate<T>,Function<T>
+4
1

, . . "" , .

, ?

. , , .

Factory . - .

T - .

, ?

, .

API-, , , , , , extends super, , .

+1

All Articles