Filters the value based on the given predicate.
predicate |
The predicate function. |
If the value is present and matches the predicate, an Optional containing the value is returned. Otherwise, returns an empty Optional. |