Collection interface in Java has, among others, these methods:
boolean add(E e) boolean addAll(Collection<? extends E> c) boolean remove(Object o) boolean removeAll(Collection<?> c) default boolean removeIf(Predicate<? super E> filter) boolean retainAll(Collection<?> c)
Common for these is what they return:
true if this collection changed as a result of the call
Or in more general terms, returns true if the method call caused anything to change, false otherwise.
Does this pattern have a name? I would like to know more about it. I have not seen it much elsewhere.