public Email myMethod(Function<MyObject, String>... functions) { ... }
I created a list of functions and I want to passed to myMethod:
List<Function<MyObject, String>> functions= new ArrayList<>();
if (condition1) {
functions.add(myObject->myObject.getStringX());
} else {
functions.add(myObject->myObject.getStringY());
}
myMethod(functions);//Does not compile, I must find a solution here
to convert my list of functions to an array that can be accepted as
myMethod argument