Program: 62783
Project: 62783
Buggy source:
@Test public void testAll(){
  ______TS("String_Node_Str");
  AccountAttributes account=dataBundle.accounts.get("String_Node_Str");
  InstructorCommentsPageData data=new InstructorCommentsPageData(account);
  boolean isViewingDraft=false;
  boolean isDisplayArchive=false;
  String courseId=course1.id;
  String courseName=course1.name;
  List<String> coursePaginationList=Arrays.asList(course1.id,course2.id);
  Map<String,List<CommentAttributes>> comments=new TreeMap<String,List<CommentAttributes>>();
  Map<String,List<Boolean>> commentModifyPermissions=new TreeMap<String,List<Boolean>>();
  CourseRoster roster=new CourseRoster(getStudentsInCourse(courseId),getInstructorsInCourse(courseId));
  List<FeedbackSessionAttributes> feedbackSessions=getFeedbackSessionsForCourse(courseId);
  int numberOfPendingComments=0;
  String giverEmail=instructor1.email;
  setInstructorComments(giverEmail,instructor1.email,courseId,comments,commentModifyPermissions);
  giverEmail=instructor2.email;
  setInstructorComments(giverEmail,instructor1.email,courseId,comments,commentModifyPermissions);
  data.init(isViewingDraft,isDisplayArchive,courseId,courseName,coursePaginationList,comments,commentModifyPermissions,roster,feedbackSessions,numberOfPendingComments);
  assertFalse(data.isDisplayArchive());
  assertFalse(data.isViewingDraft());
  assertEquals(courseId,data.getCourseId());
  assertEquals(courseName,data.getCourseName());
  assertTrue(coursePaginationList.equals(data.getCoursePaginationList()));
  Map<String,List<CommentAttributes>> actualComments=data.getComments();
  Map<String,List<CommentAttributes>> expectedComments=comments;
  List<String> actualGivers=new ArrayList<String>();
  actualGivers.addAll(actualComments.keySet());
  List<String> expectedGivers=new ArrayList<String>();
  expectedGivers.addAll(expectedComments.keySet());
  assertTrue(TestHelper.isSameContentIgnoreOrder(expectedGivers,actualGivers));
  for (  String email : expectedGivers) {
    assertEquals(expectedComments.get(email),actualComments.get(email));
  }
  assertEquals(feedbackSessions,data.getFeedbackSessions());
  String expectedNextPageLink=data.getInstructorCommentsLink() + "String_Node_Str" + course2.id;
  String expectedPreviousPageLink="String_Node_Str";
  assertEquals(expectedNextPageLink,data.getNextPageLink());
  assertEquals(expectedPreviousPageLink,data.getPreviousPageLink());
  assertEquals(numberOfPendingComments,data.getNumberOfPendingComments());
  List<InstructorCommentsForStudentsTable> expectedCommentsForStudentsTables=getCommentsForStudentsTables(courseId,commentModifyPermissions,roster,comments,data);
  List<InstructorCommentsForStudentsTable> actualCommentsForStudentsTables=data.getCommentsForStudentsTables();
  assertEquals(expectedCommentsForStudentsTables.size(),actualCommentsForStudentsTables.size());
  for (int i=0; i < expectedCommentsForStudentsTables.size(); i++) {
    assertTrue(isCommentsForStudentsTablesEqual(expectedCommentsForStudentsTables.get(i),actualCommentsForStudentsTables.get(i)));
  }
  ______TS("String_Node_Str");
  courseId=course2.id;
  courseName=course2.name;
  comments=new TreeMap<String,List<CommentAttributes>>();
  commentModifyPermissions=new TreeMap<String,List<Boolean>>();
  roster=new CourseRoster(getStudentsInCourse(courseId),getInstructorsInCourse(courseId));
  feedbackSessions=getFeedbackSessionsForCourse(courseId);
  giverEmail=instructor1.email;
  setInstructorComments(giverEmail,instructor1.email,courseId,comments,commentModifyPermissions);
  data.init(isViewingDraft,isDisplayArchive,courseId,courseName,coursePaginationList,comments,commentModifyPermissions,roster,feedbackSessions,numberOfPendingComments);
  assertFalse(data.isDisplayArchive());
  assertFalse(data.isViewingDraft());
  assertEquals(courseId,data.getCourseId());
  assertEquals(courseName,data.getCourseName());
  assertEquals(coursePaginationList,data.getCoursePaginationList());
  actualComments=data.getComments();
  expectedComments=comments;
  actualGivers=new ArrayList<String>();
  actualGivers.addAll(actualComments.keySet());
  expectedGivers=new ArrayList<String>();
  expectedGivers.addAll(expectedComments.keySet());
  assertTrue(TestHelper.isSameContentIgnoreOrder(expectedGivers,actualGivers));
  for (  String email : expectedGivers) {
    assertEquals(expectedComments.get(email),actualComments.get(email));
  }
  assertEquals(feedbackSessions,data.getFeedbackSessions());
  expectedNextPageLink="String_Node_Str";
  expectedPreviousPageLink=data.getInstructorCommentsLink() + "String_Node_Str" + course1.id;
  assertEquals(data.getNextPageLink(),expectedNextPageLink);
  assertEquals(data.getPreviousPageLink(),expectedPreviousPageLink);
  assertEquals(numberOfPendingComments,data.getNumberOfPendingComments());
  expectedCommentsForStudentsTables=getCommentsForStudentsTables(courseId,commentModifyPermissions,roster,comments,data);
  actualCommentsForStudentsTables=data.getCommentsForStudentsTables();
  assertEquals(expectedCommentsForStudentsTables.size(),actualCommentsForStudentsTables.size());
  for (int i=0; i < expectedCommentsForStudentsTables.size(); i++) {
    assertTrue(isCommentsForStudentsTablesEqual(expectedCommentsForStudentsTables.get(i),actualCommentsForStudentsTables.get(i)));
  }
}

Fixed version (ground truth):
@Test public void testAll(){
  ______TS("String_Node_Str");
  AccountAttributes account=dataBundle.accounts.get("String_Node_Str");
  InstructorCommentsPageData data=new InstructorCommentsPageData(account);
  boolean isViewingDraft=false;
  boolean isDisplayArchive=false;
  String courseId=course1.id;
  String courseName=course1.name;
  List<String> coursePaginationList=Arrays.asList(course1.id,course2.id);
  Map<String,List<CommentAttributes>> comments=new TreeMap<String,List<CommentAttributes>>();
  Map<String,List<Boolean>> commentModifyPermissions=new TreeMap<String,List<Boolean>>();
  CourseRoster roster=new CourseRoster(getStudentsInCourse(courseId),getInstructorsInCourse(courseId));
  List<FeedbackSessionAttributes> feedbackSessions=getFeedbackSessionsForCourse(courseId);
  int numberOfPendingComments=0;
  String giverEmail=instructor1.email;
  setInstructorComments(giverEmail,instructor1.email,courseId,comments,commentModifyPermissions);
  giverEmail=instructor2.email;
  setInstructorComments(giverEmail,instructor1.email,courseId,comments,commentModifyPermissions);
  data.init(isViewingDraft,isDisplayArchive,courseId,courseName,coursePaginationList,comments,commentModifyPermissions,roster,feedbackSessions,numberOfPendingComments);
  assertFalse(data.isDisplayArchive());
  assertFalse(data.isViewingDraft());
  assertEquals(courseId,data.getCourseId());
  assertEquals(courseName,data.getCourseName());
  assertTrue(coursePaginationList.equals(data.getCoursePaginationList()));
  Map<String,List<CommentAttributes>> actualComments=data.getComments();
  Map<String,List<CommentAttributes>> expectedComments=comments;
  List<String> actualGivers=new ArrayList<String>();
  actualGivers.addAll(actualComments.keySet());
  List<String> expectedGivers=new ArrayList<String>();
  expectedGivers.addAll(expectedComments.keySet());
  assertTrue(TestHelper.isSameContentIgnoreOrder(expectedGivers,actualGivers));
  for (  String email : expectedGivers) {
    assertEquals(expectedComments.get(email),actualComments.get(email));
  }
  assertEquals(feedbackSessions,data.getFeedbackSessions());
  String expectedNextPageLink=data.getInstructorCommentsLink() + "String_Node_Str" + course2.id;
  String expectedPreviousPageLink="String_Node_Str";
  assertEquals(expectedNextPageLink,data.getNextPageLink());
  assertEquals(expectedPreviousPageLink,data.getPreviousPageLink());
  assertEquals(numberOfPendingComments,data.getNumberOfPendingComments());
  List<CommentsForStudentsTable> expectedCommentsForStudentsTables=getCommentsForStudentsTables(comments,roster,data,commentModifyPermissions);
  List<CommentsForStudentsTable> actualCommentsForStudentsTables=data.getCommentsForStudentsTables();
  assertEquals(expectedCommentsForStudentsTables.size(),actualCommentsForStudentsTables.size());
  for (int i=0; i < expectedCommentsForStudentsTables.size(); i++) {
    assertTrue(isCommentsForStudentsTablesEqual(expectedCommentsForStudentsTables.get(i),actualCommentsForStudentsTables.get(i)));
  }
  ______TS("String_Node_Str");
  courseId=course2.id;
  courseName=course2.name;
  comments=new TreeMap<String,List<CommentAttributes>>();
  commentModifyPermissions=new TreeMap<String,List<Boolean>>();
  roster=new CourseRoster(getStudentsInCourse(courseId),getInstructorsInCourse(courseId));
  feedbackSessions=getFeedbackSessionsForCourse(courseId);
  giverEmail=instructor1.email;
  setInstructorComments(giverEmail,instructor1.email,courseId,comments,commentModifyPermissions);
  data.init(isViewingDraft,isDisplayArchive,courseId,courseName,coursePaginationList,comments,commentModifyPermissions,roster,feedbackSessions,numberOfPendingComments);
  assertFalse(data.isDisplayArchive());
  assertFalse(data.isViewingDraft());
  assertEquals(courseId,data.getCourseId());
  assertEquals(courseName,data.getCourseName());
  assertEquals(coursePaginationList,data.getCoursePaginationList());
  actualComments=data.getComments();
  expectedComments=comments;
  actualGivers=new ArrayList<String>();
  actualGivers.addAll(actualComments.keySet());
  expectedGivers=new ArrayList<String>();
  expectedGivers.addAll(expectedComments.keySet());
  assertTrue(TestHelper.isSameContentIgnoreOrder(expectedGivers,actualGivers));
  for (  String email : expectedGivers) {
    assertEquals(expectedComments.get(email),actualComments.get(email));
  }
  assertEquals(feedbackSessions,data.getFeedbackSessions());
  expectedNextPageLink="String_Node_Str";
  expectedPreviousPageLink=data.getInstructorCommentsLink() + "String_Node_Str" + course1.id;
  assertEquals(data.getNextPageLink(),expectedNextPageLink);
  assertEquals(data.getPreviousPageLink(),expectedPreviousPageLink);
  assertEquals(numberOfPendingComments,data.getNumberOfPendingComments());
  expectedCommentsForStudentsTables=getCommentsForStudentsTables(comments,roster,data,commentModifyPermissions);
  actualCommentsForStudentsTables=data.getCommentsForStudentsTables();
  assertEquals(expectedCommentsForStudentsTables.size(),actualCommentsForStudentsTables.size());
  for (int i=0; i < expectedCommentsForStudentsTables.size(); i++) {
    assertTrue(isCommentsForStudentsTablesEqual(expectedCommentsForStudentsTables.get(i),actualCommentsForStudentsTables.get(i)));
  }
}