public static < T > Function < T , Void > addTo ( final Collection < T > collection ) { return new Function < T , Void > ( ) { public Void apply ( T arg ) { collection . add ( arg ) ; return null ; } } ; }
Returns a function that adds its argument to the given collection .