Is there a library (e.g. Apache, Guava) that provides a List<T>
with a method
void add(Optional<T> element)
that adds the element if it is present, (and is a no-op if !element.isPresent()
)? Obviously easy to implement, but it seems like such an obvious thing it seems someone might have done it already.