diff --git a/guava/src/com/google/common/collect/Streams.java b/guava/src/com/google/common/collect/Streams.java index 3103998e8cef..01548e86c80b 100644 --- a/guava/src/com/google/common/collect/Streams.java +++ b/guava/src/com/google/common/collect/Streams.java @@ -953,7 +953,7 @@ T get() { public static OptionalInt findLast(IntStream stream) { // findLast(Stream) does some allocation, so we might as well box some more java.util.Optional boxedLast = findLast(stream.boxed()); - return boxedLast.map(OptionalInt::of).orElseGet(OptionalInt::empty); + return boxedLast.map(OptionalInt::of).orElse(OptionalInt.empty()); } /** @@ -971,7 +971,7 @@ public static OptionalInt findLast(IntStream stream) { public static OptionalLong findLast(LongStream stream) { // findLast(Stream) does some allocation, so we might as well box some more java.util.Optional boxedLast = findLast(stream.boxed()); - return boxedLast.map(OptionalLong::of).orElseGet(OptionalLong::empty); + return boxedLast.map(OptionalLong::of).orElse(OptionalLong.empty()); } /** @@ -989,7 +989,7 @@ public static OptionalLong findLast(LongStream stream) { public static OptionalDouble findLast(DoubleStream stream) { // findLast(Stream) does some allocation, so we might as well box some more java.util.Optional boxedLast = findLast(stream.boxed()); - return boxedLast.map(OptionalDouble::of).orElseGet(OptionalDouble::empty); + return boxedLast.map(OptionalDouble::of).orElse(OptionalDouble.empty()); } private Streams() {}