@Test
public void testVotesByAttendee() {

    Attendee attendee1 = sessionVote.registerAttendee(new Attendee("John Doe"));
    Attendee attendee2 = sessionVote.registerAttendee(new Attendee("Jane Doe"));
    // submit 4 votes - 3 for attendee1, and 1 for attendee2
    SessionRating sr1 = sessionVote.rateSession(new SessionRating("session1", attendee1.getId(), 3));
    SessionRating sr2 = sessionVote.rateSession(new SessionRating("session2", attendee2.getId(), 4));
    SessionRating sr3 = sessionVote.rateSession(new SessionRating("session3", attendee1.getId(), 8));
    SessionRating sr4 = sessionVote.rateSession(new SessionRating("session4", attendee1.getId(), 9));
    // API method under test
    Collection<SessionRating> attendee1Ratings = sessionVote.votesByAttendee(attendee1.getId());
    Collection<SessionRating> attendee2Ratings = sessionVote.votesByAttendee(attendee2.getId());
    assertEquals("Unexpected number of ratings from attendee1", 3, attendee1Ratings.size());
    assertTrue("Returned ratings does not include all submitted ratings by attendee1", attendee1Ratings.contains(sr1) &&
                                                                                       attendee1Ratings.contains(sr3) &&
                                                                                       attendee1Ratings.contains(sr4));
    assertEquals("Unexpected number of ratings from attendee2", 1, attendee2Ratings.size());
    assertTrue("Returned ratings does not include all submitted ratings by attendee2", attendee2Ratings.contains(sr2));
}