This commit is contained in:
Chirag Dewan 2019-04-02 17:18:44 +05:30
commit af18209504
1 changed files with 1 additions and 5 deletions

View File

@ -8,11 +8,7 @@ public class UsingOptional {
String response = doSomething(processed);
if (response == null) {
return Optional.empty();
}
return Optional.of(response);
return Optional.ofNullable(response);
}
private String doSomething(boolean processed) {