// 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 Funcy {
    public static void test(String lbl, Function<Integer,Boolean> f1, Function<Integer,Boolean> f2, BiFunction<Boolean,Boolean,Boolean> comb) {
        System.out.println(lbl + ":");
        for(int y = 0; y < 10; y++) {
            for(int x = 0; x < 10; x++) {
                System.out.printf(" %1.1b", comb.apply(f1.apply(y), f2.apply(x)));
            }
            System.out.println();
        }
    }
    public static void main(String[] args) {
        test("y < 5 and x > 4", y -> y < 5, x -> x > 4, (b1,b2) -> b1 && b2);
        test("y < 5 or x > 4", y -> y < 5, x -> x > 4, (b1,b2) -> b1 || b2);
    }
}
