API design improvement proposal: overload all methods
Found annoying to figure out each time which method to use. I'm not very good at rememebering all Java functional interfaces.
Proposal:
Give all Sneaky class methods same name (unchecked for example) thus overloading them.
Instead of writing
myStream.forEach(Sneaky.consumer(lambda));
it would look like
myStream.forEach(unchecked(lambda));
Notice static import now is more sensible.
Also it helps with refactoring when lambda signature changes.
@mleg Sounds like a good idea! Pull requests are welcome
@mleg By the way, I don't think that you should rename all methods in Sneaky class. But instead there has to be a separate unchecked method with required overloaded parameters. Because sometimes we do need to create particular functional wrapper.
var supplier = Sneaky.supplier(() -> 1);