[BAEL-14274] - Fixed article code for https://www.baeldung.com/java-optional

This commit is contained in:
amit2103 2019-06-23 21:05:41 +05:30
parent 9d7d7b4dde
commit 74f46ef95a
1 changed files with 11 additions and 0 deletions

View File

@ -259,4 +259,15 @@ public class OptionalUnitTest {
LOG.debug("Getting default value...");
return "Default Value";
}
// Uncomment code when code base is compatiable with Java 11
// @Test
// public void givenAnEmptyOptional_thenIsEmptyBehavesAsExpected() {
// Optional<String> opt = Optional.of("Baeldung");
// assertFalse(opt.isEmpty());
//
// opt = Optional.ofNullable(null);
// assertTrue(opt.isEmpty());
// }
}