private <T extends Aggregate> T aggregateOf(
      final EventStream stream,
      Class<T> clazz,
      final Optional<VersionedAggregate<T>> versionedAggregate) {
    if (versionedAggregate.isPresent()) {
      final VersionedAggregate<T> versionedAggregateValue = versionedAggregate.get();
      return defaultAggregateService.applyEvents(
          stream.readFrom(versionAfter(versionedAggregateValue)),
          versionedAggregateValue.getAggregate());
    }

    return defaultAggregateService.get(stream, clazz);
  }
 private <T extends Aggregate> long versionAfter(final VersionedAggregate<T> versionedAggregate) {
   return versionedAggregate.getVersionId() + 1L;
 }