A JavaIdiom for using instances of generic types as method parameters. Use wildcards bound by 'extends' when the generic method parameter is a "producer" of values (values are read from the parameter), and wildcards bound by 'super' when it is a "consumer" of values (values are written to the parameter). You can use the mnemonic PECS (Producer Extends, Consumer Super) for this.
Described by JoshuaBloch at JavaOne: http://developers.sun.com/learning/javaoneonline/2006/coreplatform/TS-1512.pdf
An example from JagGregate:
abstract class UnaryPredicate<A> { boolean matches( A target ); } interface Collection<E> { boolean addAll( Collection<? extends E> newElements ); Collection<E> select( UnaryPredicate<? super E> discriminator ); } UnaryPredicate<Object> evenHash = new UnaryPredicate<Object>() { public boolean matches( Object target ) { return target == null || target.hashCode() % 2 == 0; } }; Collection<Number> digits = Set.emptySet(); digits.addAll( Interval.fromTo( 0, 9 ) ); Collection<Number> digitsWithEvenHash = digits.select( evenHash );If the methods of Collection didn't use bounded wildcards, then digits.addAll() could only accept Collections with generic type Number, even though it would be OK to add Integers, Doubles, etc. Similarly, digits.select() could only accept predicates with generic type Number, even though it would be OK to let functors with generic type that is a supertype of Number have a go.