CalendarEntry calendarEntry = this.calendarEntryAggregate();
assertTrue(calendarEntry.allInvitees().isEmpty());
Participant invitee1 = new Participant("jdoe", "John Doe", "jdoe@saasovation.com");
calendarEntry.invite(invitee1);
assertFalse(calendarEntry.allInvitees().isEmpty());
assertEquals(1, calendarEntry.allInvitees().size());
assertEquals(invitee1, calendarEntry.allInvitees().iterator().next());
calendarEntry.uninvite(invitee1);
assertTrue(calendarEntry.allInvitees().isEmpty());
Participant invitee2 = new Participant("tsmith", "Tom Smith", "tsmith@saasovation.com");
calendarEntry.invite(invitee1);
calendarEntry.invite(invitee2);
assertFalse(calendarEntry.allInvitees().isEmpty());
assertEquals(2, calendarEntry.allInvitees().size());
Iterator<Participant> iterator = calendarEntry.allInvitees().iterator();
Participant participant1 = iterator.next();
Participant participant2 = iterator.next();
assertTrue(participant1.equals(invitee1) || participant1.equals(invitee2));
assertTrue(participant2.equals(invitee1) || participant2.equals(invitee2));
calendarEntry.uninvite(invitee1);
assertFalse(calendarEntry.allInvitees().isEmpty());