// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;

public class JFP {
    public static void main(String[] args) {
        List<Integer> myList = Arrays.asList(1, 2, 3, 4, 5);
        Function<Integer,Integer> square = v -> v * v;
        Function<Integer,Integer> cube = v -> v * v * v;
        myList.forEach(v -> System.out.printf("%d %d %d\n", v, square.apply(v), cube.apply(v)));
    }
}
