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.

@param from a collection of data to be transformed.
@param to a collection to contain the transformed data.
@param transformer transforms the data.
geode-core/src/main/java/org/apache/geode/internal/util/TransformUtils.java