class CompetitionSetupServiceImpl implements CompetitionSetupService {

    @Override
    public boolean isCompetitionReadyToOpen(CompetitionResource competitionResource) {
        if (competitionResource.getCompetitionStatus() != CompetitionStatus.COMPETITION_SETUP) {
            return false;
        }

        Map<CompetitionSetupSection, Optional<Boolean>> statuses = competitionSetupRestService.getSectionStatuses(competitionResource.getId()).getSuccess();

        Optional<CompetitionSetupSection> notDoneSection = getRequiredSectionsForReadyToOpen().stream()
                .filter(section -> isNotDoneSection(statuses, section))
                .findFirst();

        return !notDoneSection.isPresent();
    }

}