I.e. instead of:
if (value != null) { doSomething(value); }do:
OptionalmaybeValue = Optional.ofNullable(value); if (maybeValue.isPresent()) { doSomething(maybeValue.get()); }
if (value != null) { doSomething(value); }do:
OptionalmaybeValue = Optional.ofNullable(value); if (maybeValue.isPresent()) { doSomething(maybeValue.get()); }