From 74f46ef95a78c64c0ba53237f9048f68544d3d2e Mon Sep 17 00:00:00 2001 From: amit2103 Date: Sun, 23 Jun 2019 21:05:41 +0530 Subject: [PATCH] [BAEL-14274] - Fixed article code for https://www.baeldung.com/java-optional --- .../com/baeldung/java8/optional/OptionalUnitTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OptionalUnitTest.java b/core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OptionalUnitTest.java index bd7943c77b..bf594610bb 100644 --- a/core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OptionalUnitTest.java +++ b/core-java-modules/core-java-8/src/test/java/com/baeldung/java8/optional/OptionalUnitTest.java @@ -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 opt = Optional.of("Baeldung"); +// assertFalse(opt.isEmpty()); +// +// opt = Optional.ofNullable(null); +// assertTrue(opt.isEmpty()); +// } + } \ No newline at end of file