Description
The implementation of the methods asRunnable(), asConsumer(), asCallable(), asBiConsumer() etc. is redundant and copy-paste. They are implemented with the structure (example from asRunnable():
return () -> { try { pRunnable.run(); } catch (Throwable t) { throw rethrow(t); } };
This try-catch structure is already implemented in the class and can be used here simplifying the method to
return () -> run(pRunnable);
Also, the tests for asPredicate() and asBiPredicate() are missing.
Attachments
Issue Links
- is duplicated by
-
LANG-1515 A generic Fuction that can wrap functions that throw checked throwables
- Closed