Skip to content

Commit 74f46ef

Browse files
committed
[BAEL-14274] - Fixed article code for https://www.baeldung.com/java-optional
1 parent 9d7d7b4 commit 74f46ef

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OptionalUnitTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,4 +259,15 @@ public String getMyDefault() {
259259
LOG.debug("Getting default value...");
260260
return "Default Value";
261261
}
262+
263+
// Uncomment code when code base is compatiable with Java 11
264+
// @Test
265+
// public void givenAnEmptyOptional_thenIsEmptyBehavesAsExpected() {
266+
// Optional<String> opt = Optional.of("Baeldung");
267+
// assertFalse(opt.isEmpty());
268+
//
269+
// opt = Optional.ofNullable(null);
270+
// assertTrue(opt.isEmpty());
271+
// }
272+
262273
}

0 commit comments

Comments
 (0)