private boolean hasVerifiedSponsorRole(
     FirebirdUser currentUser, UserSessionInformation sessionInformation) {
   for (SponsorRole role : currentUser.getSponsorRoles()) {
     if (sessionInformation.getGroupNames().contains(role.getVerifiedSponsorGroupName())) {
       return true;
     }
   }
   return false;
 }
  @Test
  public void testGenerateTasks_CtepSponsor() throws Exception {
    Set<String> groupNames = Sets.newHashSet();
    sponsor.getSponsorRoles().clear();
    Organization ctepSponsor = new Organization();
    sponsor.addSponsorRepresentativeRole(ctepSponsor);
    when(mockSponsorService.getSponsorOrganizationWithAnnualRegistrations())
        .thenReturn(ctepSponsor);

    List<Task> tasks = generator.generateTasks(sponsor, groupNames);

    assertTrue(tasks.isEmpty());
  }
  @Test
  public void
      testGenerateTasks_RegistrationReadyForApproval_NotSponsorRepresentativeForProtocolSponsor()
          throws Exception {
    sponsor.getSponsorRoles().clear();
    groupNames.clear();
    SponsorRole sponsorDelegateRole = sponsor.addSponsorDelegateRole(sponsorOrganization);
    groupNames.add(sponsorDelegateRole.getVerifiedSponsorGroupName());
    InvestigatorRegistration registration =
        RegistrationFactory.getInstance().createInvestigatorRegistration(ACCEPTED);
    setUpMockRegistrationServiceToReturnRegistration(registration);
    registration.getProtocol().setSponsor(sponsorOrganization);

    List<Task> tasks = generator.generateTasks(sponsor, groupNames);

    assertTrue(tasks.isEmpty());
  }