class AssignButtonsPopulator {

    public AssignButtonsViewModel populate(AbstractApplicantResource resource, ApplicantQuestionResource question, boolean hideAssignButtons) {
        AssignButtonsViewModel viewModel = new AssignButtonsViewModel();
        viewModel.setAssignedBy(question.allAssignedStatuses()
                .map(ApplicantQuestionStatusResource::getAssignedBy).map(ApplicantResource::getProcessRole).findAny().orElse(null));
        viewModel.setAssignee(question.allAssignedStatuses()
                .map(ApplicantQuestionStatusResource::getAssignee).map(ApplicantResource::getProcessRole).findAny().orElse(null));
        viewModel.setLeadApplicant(resource.getApplicants().stream().filter(ApplicantResource::isLead).map(ApplicantResource::getProcessRole).findAny().orElse(null));
        viewModel.setCurrentApplicant(resource.getCurrentApplicant().getProcessRole());
        viewModel.setAssignableApplicants(resource.getApplicants().stream().map(ApplicantResource::getProcessRole).collect(Collectors.toList()));
        viewModel.setPendingAssignableUsers(inviteService.getPendingInvitationsByApplicationId(resource.getApplication().getId()));
        viewModel.setHideAssignButtons(hideAssignButtons);
        viewModel.setQuestion(question.getQuestion());
        return viewModel;
    }

    public  AssignButtonsPopulator(InviteService inviteService);

}