void (Optional<String> opt, Function<String, Object> onPresent, Supplier<Object> onEmpty) { // information level: could be semantic change if onPresent returns null Object o = opt.is<caret>Present() ? onPresent.apply(opt.get()) : onEmpty.get(); }