class CollectionHelper {

    public static <T, E> void process(Collection<T> collection, Collection<E> result, ObjectProcess<T, E> process) {
        if (collection == null || collection.size() == 0) {
            logger.error("collection is empty or is null");
            return;
        }
        if (result == null || result.size() == 0) {
            logger.error("receive collection is empty or is null");
            return;
        }
        for (T t : collection) {
            E next = process.process(t);
            if (next != null) {
                result.add(next);
            }
        }
    }

}