class ThingCreatedStrategy extends AbstractThingEventStrategy<ThingCreated> {

    @Override
    public Thing handle(final ThingCreated event, final @Nullable Thing thing, final long revision) {
        return event.getThing()
                .toBuilder()
                .setLifecycle(ThingLifecycle.ACTIVE)
                .setRevision(revision)
                .setModified(event.getTimestamp().orElseGet(() -> event.getThing().getModified().orElse(null)))
                .setCreated(event.getTimestamp().orElseGet(() -> event.getThing().getCreated().orElse(null)))
                .setMetadata(event.getMetadata().orElseGet(() -> event.getThing().getMetadata().orElse(null)))
                .build();
    }

}