class ManageInvitationsModelPopulator {

    public ManageInvitationsViewModel populateManageInvitationsViewModel(long projectId) {

        ProjectResource project = projectService.getById(projectId);
        List<SentGrantsInviteResource> grants = grantsInviteRestService.getAllForProject(projectId).getSuccess()
                .stream().filter(grant -> InviteStatus.SENT == grant.getStatus())
                .collect(Collectors.toList());

        return new ManageInvitationsViewModel(project.getCompetition(),
                                            project.getCompetitionName(),
                                            project.getId(),
                                            project.getName(),
                                            project.getApplication(),
                                            grants);
    }

}