class QuestionSetupAddAndRemoveServiceImpl implements QuestionSetupAddAndRemoveService {

    @Override
    public ServiceResult<Question> addDefaultAssessedQuestionToCompetition(Competition competition) {
        //todo replace without template
        if (competition == null || competitionIsNotInSetupOrReadyToOpenState(competition)) {
            return serviceFailure(new Error(COMPETITION_NOT_EDITABLE));
        }

        return find(sectionRepository.findFirstByCompetitionIdAndName(
                competition.getId(),
                APPLICATION_QUESTIONS.getName()),
                notFoundError(Section.class)
        ).andOnSuccess(section -> initializeAndPersistQuestion(section, competition));
    }

}