I think it is not since empty List is returned just for the purpose of
the postcondition checking. You will use this method only when you
want to perform some kind of postcondition check:
Collection results = ...;
if(emptyToNull(results).size() > 10) {} // check postcondition
If non-empty collection is returned, it is not wrapped in to List.
Regarding isNullOrEmpty - this allows to me only to check if results
are empty or null. I cannot check other postconditions in the same
line (as size() for example).
On 8 Lis, 13:10, Nikolas Everett <
nik9...@gmail.com> wrote:
> I think it is a bit much to assume that the user wants an ArrayList when the
> signature is collection. If you just plan on using the method to check the
> results of inconsistent APIs might I suggest an isNullOrEmpty method like
> commons lang provides for strings?
>
> Nik
> > unsubscribe:
guava-discus...@googlegroups.com<guava-discuss%2Bunsubscribe@goog
legroups.com>