<R> DeferredResult<R> collect(Function<? super T, Optional<? extends R>> collector)