isempty
IsEmpty is a common predicate in programming used to determine whether a container-like object has no elements. It is implemented as a method or function on many data types, including strings, arrays, lists, maps, and sets. When isEmpty returns true, the object contains zero elements; when false, it contains at least one element. For strings, emptiness typically means the string has zero characters; for collections, it means the number of elements is zero.
In Java, String has isEmpty(), which returns true if length() is 0. Subtypes of Collection also provide
Nullability matters: calling isEmpty on a null reference usually results in an error; frameworks sometimes offer