This will be a functional approach using map :
Function<Boolean, Void> logic = isTrue -> { if (isTrue) trueMethod(someValue); else falseMethod(someValue); return null; }; doIt.map(logic);
However, it is really ugly , mainly because of your "not very functional" trueMethod / falseMethod , which returns void (leading to an ugly return null ).
source share