Program: 63013
Project: 63013
Buggy source:
@Test public void testGetTeamsForCourse() throws Exception {
  ______TS("String_Node_Str");
  restoreTypicalDataInDatastore();
  String methodName="String_Node_Str";
  Class<?>[] paramTypes=new Class<?>[]{String.class};
  Object[] params=new Object[]{"String_Node_Str"};
  verifyCannotAccess(USER_TYPE_NOT_LOGGED_IN,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_UNREGISTERED,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_STUDENT,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_COORD,methodName,"String_Node_Str",paramTypes,new Object[]{"String_Node_Str"});
  verifyCanAccess(USER_TYPE_COORD,methodName,"String_Node_Str",paramTypes,params);
  ______TS("String_Node_Str");
  restoreTypicalDataInDatastore();
  loginAsAdmin("String_Node_Str");
  CourseData course=dataBundle.courses.get("String_Node_Str");
  logic.createStudent(new StudentData("String_Node_Str",course.id));
  logic.createStudent(new StudentData("String_Node_Str",course.id));
  CourseData courseAsTeams=logic.getTeamsForCourse(course.id);
  assertEquals(2,courseAsTeams.teams.size());
  String team1Id="String_Node_Str";
  assertEquals(team1Id,courseAsTeams.teams.get(0).name);
  assertEquals(4,courseAsTeams.teams.get(0).students.size());
  assertEquals(team1Id,courseAsTeams.teams.get(0).students.get(0).team);
  assertEquals(team1Id,courseAsTeams.teams.get(0).students.get(1).team);
  String team2Id="String_Node_Str";
  assertEquals(team2Id,courseAsTeams.teams.get(1).name);
  assertEquals(1,courseAsTeams.teams.get(1).students.size());
  assertEquals(team2Id,courseAsTeams.teams.get(1).students.get(0).team);
  assertEquals(2,courseAsTeams.loners.size());
  assertEquals("String_Node_Str",courseAsTeams.loners.get(0).email);
  assertEquals("String_Node_Str",courseAsTeams.loners.get(1).email);
  ______TS("String_Node_Str");
  restoreTypicalDataInDatastore();
  courseAsTeams=logic.getTeamsForCourse(course.id);
  assertEquals(4,courseAsTeams.teams.get(0).students.size());
  assertEquals(0,courseAsTeams.loners.size());
  assertEquals(null,logic.getTeamsForCourse(null));
  ______TS("String_Node_Str");
  logic.createCourse("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(0,logic.getTeamsForCourse("String_Node_Str").teams.size());
  ______TS("String_Node_Str");
  try {
    logic.getTeamsForCourse("String_Node_Str");
    fail();
  }
 catch (  EntityDoesNotExistException e) {
    BaseTestCase.assertContains("String_Node_Str",e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testGetTeamsForCourse() throws Exception {
  ______TS("String_Node_Str");
  restoreTypicalDataInDatastore();
  String methodName="String_Node_Str";
  Class<?>[] paramTypes=new Class<?>[]{String.class};
  Object[] params=new Object[]{"String_Node_Str"};
  verifyCannotAccess(USER_TYPE_NOT_LOGGED_IN,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_UNREGISTERED,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_STUDENT,methodName,"String_Node_Str",paramTypes,params);
  verifyCanAccess(USER_TYPE_STUDENT,methodName,"String_Node_Str",paramTypes,params);
  verifyCannotAccess(USER_TYPE_COORD,methodName,"String_Node_Str",paramTypes,new Object[]{"String_Node_Str"});
  verifyCanAccess(USER_TYPE_COORD,methodName,"String_Node_Str",paramTypes,params);
  ______TS("String_Node_Str");
  restoreTypicalDataInDatastore();
  loginAsAdmin("String_Node_Str");
  CourseData course=dataBundle.courses.get("String_Node_Str");
  logic.createStudent(new StudentData("String_Node_Str",course.id));
  logic.createStudent(new StudentData("String_Node_Str",course.id));
  CourseData courseAsTeams=logic.getTeamsForCourse(course.id);
  assertEquals(2,courseAsTeams.teams.size());
  String team1Id="String_Node_Str";
  assertEquals(team1Id,courseAsTeams.teams.get(0).name);
  assertEquals(4,courseAsTeams.teams.get(0).students.size());
  assertEquals(team1Id,courseAsTeams.teams.get(0).students.get(0).team);
  assertEquals(team1Id,courseAsTeams.teams.get(0).students.get(1).team);
  String team2Id="String_Node_Str";
  assertEquals(team2Id,courseAsTeams.teams.get(1).name);
  assertEquals(1,courseAsTeams.teams.get(1).students.size());
  assertEquals(team2Id,courseAsTeams.teams.get(1).students.get(0).team);
  assertEquals(2,courseAsTeams.loners.size());
  assertEquals("String_Node_Str",courseAsTeams.loners.get(0).email);
  assertEquals("String_Node_Str",courseAsTeams.loners.get(1).email);
  ______TS("String_Node_Str");
  restoreTypicalDataInDatastore();
  courseAsTeams=logic.getTeamsForCourse(course.id);
  assertEquals(4,courseAsTeams.teams.get(0).students.size());
  assertEquals(0,courseAsTeams.loners.size());
  assertEquals(null,logic.getTeamsForCourse(null));
  ______TS("String_Node_Str");
  logic.createCourse("String_Node_Str","String_Node_Str","String_Node_Str");
  assertEquals(0,logic.getTeamsForCourse("String_Node_Str").teams.size());
  ______TS("String_Node_Str");
  try {
    logic.getTeamsForCourse("String_Node_Str");
    fail();
  }
 catch (  EntityDoesNotExistException e) {
    BaseTestCase.assertContains("String_Node_Str",e.getMessage());
  }
}