Closed
Description
This issue was originally filed by [email protected]
As there is no isNotEmpty matcher, you are forced to use isNot(isEmpty). However, expect(null, isNot(isEmpty)) passes because isEmpty returns false for non-collections or null. So, likewise, any other non-collection object would also wrongly pass such an expect call.
My suggested solution would be for isEmpty to throw an exception for "wrong" types.
Alternatively, an isNotEmpty matcher could be added.
Thanks,
Andreas