From bfc5132d32cb5d3685823263a546faa801908d00 Mon Sep 17 00:00:00 2001 From: Dave Brosius Date: Mon, 4 Nov 2024 10:27:53 -0500 Subject: [PATCH] add example for #386 --- src/samples/java/ex/OI_Sample.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/samples/java/ex/OI_Sample.java b/src/samples/java/ex/OI_Sample.java index 35b0ef03..e07b67d8 100644 --- a/src/samples/java/ex/OI_Sample.java +++ b/src/samples/java/ex/OI_Sample.java @@ -6,7 +6,7 @@ import java.util.OptionalInt; import java.util.function.Supplier; -public class OI_Sample { +public class OI_Sample implements OptInf386 { public String useDelayedExecution(Optional o, String a, String b) { @@ -73,4 +73,12 @@ public String fpGet384(String parameterName, Supplier defaultValueSuppli public boolean equalsToEmpty(Optional foo) { return foo.equals(Optional.empty()); } + + public Optional getOpt386() { + return Optional.of(Double.valueOf(10)); + } +} + +interface OptInf386 { + Optional getOpt386(); }