class MenuModelPopulator implements CompetitionSetupSectionModelPopulator {

	@Override
	public CompetitionSetupViewModel populateModel(GeneralSetupViewModel generalViewModel, CompetitionResource competitionResource) {
		PublicContentResource publicContent = publicContentService.getCompetitionById(competitionResource.getId());
		Map<CompetitionSetupSection, Optional<Boolean>> statuses = competitionSetupRestService.getSectionStatuses(competitionResource.getId()).getSuccess();
		Map<CompetitionSetupSection, Boolean> statusesWithValues = simpleMapKeyAndValue(statuses, key -> key, status -> status.orElse(false));
		return new MenuViewModel(generalViewModel, publicContent.getPublishDate(), isPublicContentPublished(publicContent), statusesWithValues);
	}

}