A nullary (zero-parameter) "function" that is a bit friendlier to testing.
This is a variant of () => A -- that is, a function that takes no parameters
and returns an A. In practice, that isn't quite true: where () => A is
lazy (it is not evaluated until you call it), this one is strict (you pass the
result in as a parameter).
In exchange, this is more usable and reproducible for test environments. Its
hashCode and equals are based on those of the passed-in value (so they are
consistent and reproducible), and its toString nicely displays the result
that will always be returned.
A nullary (zero-parameter) "function" that is a bit friendlier to testing.
This is a variant of
() => A
-- that is, a function that takes no parameters and returns an A. In practice, that isn't quite true: where() => A
is lazy (it is not evaluated until you call it), this one is strict (you pass the result in as a parameter).In exchange, this is more usable and reproducible for test environments. Its
hashCode
andequals
are based on those of the passed-in value (so they are consistent and reproducible), and itstoString
nicely displays the result that will always be returned.the type that is returned by this function