Inputs to standard libraries will obviously never NPE if you pass in a non-null value.
For outputs, a lot of standard collection .get() calls are unnecessary when you’re working with small collections or Optionals, where you simply use stream, filter, ifPresent.
Or simply wrap the return with Optional.ofNullable, checkstyle will not accept it if you don’t.
No comments yet.