class RunEntityService extends AbstractEntityService<
        Run,
        RunAddPayload,
        RunGateway> {

    @Override
    public Run add(RunAddPayload addPayload) throws AddEntityException {
        Run lastInSequenceForEvent = gateway.findLastInSequenceForEvent(addPayload.getEvent());
        addPayload.setSequence(
                1 + (lastInSequenceForEvent != null ? lastInSequenceForEvent.getSequence() : 0)
        );
        return gateway.add(addPayload);
    }

    @Inject public  RunEntityService(RunGateway gateway, EventEntityService eventEntityService);

}