@Test
public void testDeleteRating() {

    Attendee attendee1 = sessionVote.registerAttendee(new Attendee("Jon Don"));
    Attendee attendee2 = sessionVote.registerAttendee(new Attendee("Do Doo"));
    SessionRating sessionRatingToDelete = new SessionRating("session1", attendee1.getId(), 5);
    sessionRatingToDelete = sessionVote.rateSession(sessionRatingToDelete);
    String ratingId = sessionRatingToDelete.getId();
    String attendeeId = sessionRatingToDelete.getAttendeeId();
    SessionRating sessionRatingToKeep = new SessionRating("session1", attendee2.getId(), 5);
    sessionRatingToKeep = sessionVote.rateSession(sessionRatingToKeep);
    sessionVote.deleteRating(ratingId);
    assertFalse("The deleted session was not retrieved as expected", sessionVote.getAllSessionRatings().contains(sessionRatingToDelete));
    // Now verify that there is one rating in the system
    Collection<SessionRating> ratings = sessionVote.getAllSessionRatings();
    assertEquals("An unexpected number of rating have been registered", 1, ratings.size());
    //one rating left for this session
    ratings = sessionVote.allSessionVotes(sessionRatingToDelete.getSession());
    assertEquals("An unexpected number of rating have been registered", 1, ratings.size());
    Collection<SessionRating> ratingForAttendee = sessionVote.votesByAttendee(attendeeId);
    assertEquals("An unexpected number of rating have been registered", 0, ratingForAttendee.size());
}