class InterviewFeedbackViewModelPopulator {

    public InterviewFeedbackViewModel populate(long applicationId, String competitionName, UserResource userResource, boolean isFeedbackReleased) {
        String responseFilename = ofNullable(interviewResponseRestService.findResponse(applicationId).getSuccess())
                .map(FileEntryResource::getName)
                .orElse(null);

        Optional<ProcessRoleResource> role = userRestService.findProcessRole(userResource.getId(), applicationId).getOptionalSuccessObject();

        String feedbackFilename = ofNullable(interviewAssignmentRestService.findFeedback(applicationId).getSuccess())
                .map(FileEntryResource::getName)
                .orElse(null);

        return new InterviewFeedbackViewModel(applicationId,
                competitionName,
                responseFilename,
                feedbackFilename,
                role.map(ProcessRoleResource::getRole).map(Role::isLeadApplicant).orElse(false),
                isFeedbackReleased,
                userResource.hasRole(Role.ASSESSOR) || userResource.hasAnyRoles(Role.internalRoles())
        );
    }

    public  InterviewFeedbackViewModelPopulator(InterviewResponseRestService interviewResponseRestService, InterviewAssignmentRestService interviewAssignmentRestService, UserRestService userRestService);

}