Is adapting a no-arg method into a Consumer bad form?
问题 Someone raised a question on another SO Answer about whether it is bad practice or inefficient to do this: Optional<User> user = ... user.ifPresent(u -> doSomethingWithoutUser()); instead of if (user.isPresent()) doSomethingWithoutUser(); Specifically, the fact that we're adapting a zero-arg method into a Consumer<User> which ignores its parameter u . As this isn't a Stream non-terminal operation, the fact doSomethingWithoutUser() likely has side-effects isn't a concern. I'm not bothered