public static <S, T> Pair<Collection<S>, Collection<T>> unzip(
      final Collection<Pair<S, T>> elements) {
    final Collection<S> firstList = new ArrayList<S>(elements.size());
    final Collection<T> secondList = new ArrayList<T>(elements.size());

    for (final Pair<S, T> pair : elements) {
      firstList.add(pair.first());
      secondList.add(pair.second());
    }

    return new Pair<Collection<S>, Collection<T>>(firstList, secondList);
  }
Performs an operation on all items that pass a filter check.

@param <ItemType> The type of the items in the collection.
@param <CollectionType> The type of the collection.
@param collection The collection that provides the items.
@param callback The callback that filters the collection and performs an operation on each item
    that passes the filter check.
java/zylib/src/main/java/com/google/security/zynamics/zylib/types/common/CollectionHelpers.java