Skip to content

Instantly share code, notes, and snippets.

@djcsdy
djcsdy / Map.java
Created February 10, 2011 18:15
Example of functional-style ‘map’ in Java. Isn’t it revolting? :)
package net.noiseinstitute.lambda;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class Map {
public static <T,U> List<U> map (Collection<T> collection, MapCallback<T,U> callback) {
List<U> list = new ArrayList<U>();