public static <T1,T2>void transform(Collection<T1> from,Collection<T2> to,Transformer<T1,T2> transformer){
  for (  T1 instance : from) {
    to.add(transformer.transform(instance));
  }
}

public static < T1 , T2 > void transform ( Collection < T1 > from , Collection < T2 > to , Transformer < T1 , T2 > transformer ) { for ( T1 instance : from ) { to . add ( transformer . transform ( instance ) ) ; } }
transforms a collection of one data type into another .
