filter

abstract fun filter(predicate: (T) -> Boolean): Optional<out T>

Keeps the contained value, if any, only if it satisfies predicate; propagates None unchanged.