// 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.function.BiFunction;
import java.util.function.Function;

public class FuncFun {
    public static void main(String[] args) {
        Function<Integer,Boolean> lt5 = (y) -> y < 5;
        Function<Integer,Boolean> gt4 = (x) -> x > 4;
        BiFunction<Integer,Integer,Boolean> comb = (y, x) -> lt5.apply(y) && gt4.apply(x);
        for(int y = 0; y < 10; y++) {
            for(int x = 0; x < 10; x++) {
                System.out.printf(" %1.1b", comb.apply(y, x));
            }
            System.out.println();
        }
    }
}
