@Test
public void testValidAndInvalidPrincipalsInRecipientToForSendAsSeparateMails() {

    // setup
    OLATPrincipal invalidRecipient = ObjectMother.createInvalidPrincipal();
    recipients.add(invalidRecipient);
    int numberOfSeparateMails = recipients.size();
    MailerResult result = new MailerResult();
    //
    result = mailerWithTemplate.sendMailAsSeparateMails(recipients, null, recipientsBCC, template, ruedi);
    // verify
    assertEquals(MailerResult.OK, result.getReturnCode());
    assertNotNull("failed email must be reported, hence not null", result.getFailedIdentites());
    assertEquals(1, result.getFailedIdentites().size());
    verifyTimesCallingCreateAndSendMessageInvocationsFor(numberOfSeparateMails, recipients, null, recipientsBCC);
}