[LANG-1498] Add support of lambda value evaluation for defaulting
methods #416. A few more tests.
This commit is contained in:
parent
a4c60c4e01
commit
8445d3a991
|
@ -118,6 +118,8 @@ public class ObjectUtilsTest {
|
||||||
assertSame(o, ObjectUtils.defaultIfNull(o, dflt), "dflt was returned when o was not null");
|
assertSame(o, ObjectUtils.defaultIfNull(o, dflt), "dflt was returned when o was not null");
|
||||||
assertSame(dflt, ObjectUtils.defaultIfNull(null, () -> dflt), "dflt was not returned when o was null");
|
assertSame(dflt, ObjectUtils.defaultIfNull(null, () -> dflt), "dflt was not returned when o was null");
|
||||||
assertSame(o, ObjectUtils.defaultIfNull(o, () -> dflt), "dflt was returned when o was not null");
|
assertSame(o, ObjectUtils.defaultIfNull(o, () -> dflt), "dflt was returned when o was not null");
|
||||||
|
assertSame(o, ObjectUtils.defaultIfNull(FOO, () -> dflt), "dflt was returned when o was not null");
|
||||||
|
assertSame(o, ObjectUtils.defaultIfNull("foo", () -> dflt), "dflt was returned when o was not null");
|
||||||
MutableInt callsCounter = new MutableInt(0);
|
MutableInt callsCounter = new MutableInt(0);
|
||||||
Supplier<Object> countingDefaultSupplier = () -> {
|
Supplier<Object> countingDefaultSupplier = () -> {
|
||||||
callsCounter.increment();
|
callsCounter.increment();
|
||||||
|
|
Loading…
Reference in New Issue