// 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) 
public class FunctionFun {
    public static @interface Arg {
        public String value();
    }
    @FunctionalInterface
    public static interface Func1 {
        public void doSomething(Integer a1);
    }
    @FunctionalInterface
    public static interface Func2 {
        public void doSomething(Integer a1, Integer a2);
    }
    @FunctionalInterface
    public static interface Func3 {
        public void doSomething(Integer a1, Integer a2, Integer a3);
    }
    public static class MyFunctionManager {
        public void addFunction(Func1 action) {
        }
        public void addFunction(Func2 action) {
        }
        public void addFunction(Func3 action) {
        }
    }
    public static void main(String[] args) {
        final MyFunctionManager myFunctionManager = new MyFunctionManager();
        myFunctionManager.addFunction((@Arg("op1") Integer op1, @Arg("op2") Integer op2) -> {
            System.out.println("result: " + (op1 + op2));
        });
        myFunctionManager.addFunction((@Arg("op1") Integer op1, @Arg("op2") Integer op2, @Arg("op3") Integer op3) -> {
            System.out.println("result: " + (op1 * op2 * op3));
        });
    }
}
