This is especially true with Java 8's lambda syntax and method references. Because a Java function's signature includes its checked exceptions, implementing a functional interface can require lots of verbose nested try-catches.
e.g. rather than being able to write:
foodOnPlate.forEach(this::eat);
You end up having to write: foodOnPlate.forEach(food -> {
try {
eat(food)
} catch (Barf e) {
// handle? rethrow as unchecked?
}
});
This library does a pretty god job handling that case:https://github.com/diffplug/durian/blob/master/test/com/diff...