Home
last modified time | relevance | path

Searched refs:orElse (Results 1 – 12 of 12) sorted by relevance

/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DIntReduceTest.java60 assertEquals(folded, seedless.orElse(0)); in testOps()
64 assertEquals(folded, seedless.orElse(Integer.MAX_VALUE)); in testOps()
68 assertEquals(folded, seedless.orElse(Integer.MIN_VALUE)); in testOps()
72 assertEquals(folded, seedless.orElse(0)); in testOps()
76 assertEquals(folded, seedless.orElse(Integer.MAX_VALUE)); in testOps()
80 assertEquals(folded, seedless.orElse(Integer.MIN_VALUE)); in testOps()
DReduceTest.java66 assertEquals(folded, seedless.orElse(0)); in testOps()
70 assertEquals(folded, seedless.orElse(Integer.MAX_VALUE)); in testOps()
74 assertEquals(folded, seedless.orElse(Integer.MIN_VALUE)); in testOps()
78 assertEquals(folded, seedless.orElse(0)); in testOps()
82 assertEquals(folded, seedless.orElse(Integer.MAX_VALUE)); in testOps()
86 assertEquals(folded, seedless.orElse(Integer.MIN_VALUE)); in testOps()
DFindFirstOpTest.java55 …exerciseOps(countTo(0), s -> Arrays.asList(new Integer[]{s.findFirst().orElse(-1)}).stream(), Arra… in testFindFirst()
56 …), s -> Arrays.asList(new Integer[]{s.filter(e -> e == 1499).findFirst().orElse(-1)}).stream(), Ar… in testFindFirst()
DTabulatorsTest.java292 s -> s.min(Integer::compare).orElse(Integer.MAX_VALUE));
294 s -> s.max(Integer::compare).orElse(Integer.MIN_VALUE));
314 s -> s.mapToInt(x -> x * 2).average().orElse(0));
316 s -> s.mapToLong(x -> x * 2).average().orElse(0));
318 s -> s.mapToDouble(x -> x * 2).average().orElse(0));
333 s -> s.mapToInt(x -> x * 2).average().orElse(0));
/libcore/luni/src/test/java/libcore/java/util/
DOptionalIntTest.java60 assertEquals(57, OptionalInt.empty().orElse(57)); in testOrElse()
61 assertEquals(56, OptionalInt.of(56).orElse(57)); in testOrElse()
DOptionalLongTest.java60 assertEquals(57, OptionalLong.empty().orElse(57)); in testOrElse()
61 assertEquals(56, OptionalLong.of(56).orElse(57)); in testOrElse()
DOptionalDoubleTest.java62 assertEquals(57.0, OptionalDouble.empty().orElse(57.0)); in testOrElse()
63 assertEquals(56.0, OptionalDouble.of(56.0).orElse(57.0)); in testOrElse()
DOptionalTest.java167 assertSame(bar, empty.orElse(bar)); in testOrElse()
168 assertSame(bar, ofNull.orElse(bar)); in testOrElse()
172 assertSame(foo, optionalFoo.orElse(bar)); in testOrElse()
/libcore/ojluni/src/main/java/java/util/
DOptionalInt.java147 public int orElse(int other) { in orElse() method in OptionalInt
DOptionalLong.java147 public long orElse(long other) { in orElse() method in OptionalLong
DOptionalDouble.java147 public double orElse(double other) { in orElse() method in OptionalDouble
DOptional.java248 public T orElse(T other) { in orElse() method in Optional