class UserServiceImpl implements UserService {

    @Override
    public Boolean isLeadApplicant(Long userId, ApplicationResource application) {
        List<ProcessRoleResource> userApplicationRoles = userRestService.findProcessRole(application.getId()).getSuccess();
        return userApplicationRoles.stream().anyMatch(uar -> uar.getRoleName()
                .equals(Role.LEADAPPLICANT.getName()) && uar.getUser().equals(userId));

    }

}