public final class If<T>extends Object
implements Optional<T>
Optional decorator restrains the presence of another Optional with a specific (independent) condition.
Example
// only finite recurrence sets have a last occurrence!
Optional<DateTime> lastOccurrence = new If<>(new Not<>(recurrenceSet::isInfinite), new Last<>(recurrenceSet))