Program: 31706
Project: 31706
Buggy source:
/** 
 * @see DATAGRAPH-690//TODO Fix this.
 */
@Test @Ignore public void shouldCreateGraphProperly(){
  Person jim=new Person();
  Person mary=new Person();
  Person bill=new Person();
  jim.name="String_Node_Str";
  mary.name="String_Node_Str";
  bill.name="String_Node_Str";
  bill.peopleIFollow.add(jim);
  bill.peopleILike.add(mary);
  bill.peopleWhoFollowMe.add(mary);
  mary.peopleIFollow.add(bill);
  mary.peopleIFollow.add(jim);
  mary.peopleILike.add(jim);
  mary.peopleWhoLikeMe.add(bill);
  mary.peopleWhoFollowMe.add(jim);
  mary.peopleWhoLikeMe.add(jim);
  jim.peopleIFollow.add(mary);
  jim.peopleILike.add(mary);
  jim.peopleWhoFollowMe.add(bill);
  jim.peopleWhoFollowMe.add(mary);
  jim.peopleWhoLikeMe.add(mary);
  session.save(jim);
  Movie matrix=new Movie();
  matrix.name="String_Node_Str";
  Movie dieHard=new Movie();
  dieHard.name="String_Node_Str";
  Rating ratingOne=Rating.create(bill,matrix,4);
  Rating ratingTwo=Rating.create(bill,matrix,5);
  Rating ratingThree=Rating.create(jim,matrix,3);
  Rating ratingFour=Rating.create(jim,dieHard,5);
  Rating ratingFive=Rating.create(mary,dieHard,5);
  bill.movieRatings.add(ratingOne);
  matrix.ratings.add(ratingOne);
  bill.movieRatings.add(ratingTwo);
  matrix.ratings.add(ratingTwo);
  jim.movieRatings.add(ratingThree);
  matrix.ratings.add(ratingThree);
  jim.movieRatings.add(ratingFour);
  dieHard.ratings.add(ratingFour);
  mary.movieRatings.add(ratingFive);
  dieHard.ratings.add(ratingFive);
  session.save(bill);
  session.save(jim);
  session.save(mary);
  idDieHard=dieHard.id;
  idMatrix=matrix.id;
  idJim=jim.id;
  idBill=bill.id;
  idMary=mary.id;
  session.clear();
  jim=session.load(Person.class,idJim);
  assertEquals(2,jim.movieRatings.size());
  assertEquals(1,jim.peopleILike.size());
  assertEquals(1,jim.peopleWhoLikeMe.size());
  assertEquals(1,jim.peopleIFollow.size());
  assertEquals(2,jim.peopleWhoFollowMe.size());
  bill=session.load(Person.class,idBill);
  assertEquals(2,bill.movieRatings.size());
  assertEquals(1,bill.peopleILike.size());
  assertEquals(0,bill.peopleWhoLikeMe.size());
  assertEquals(1,bill.peopleIFollow.size());
  assertEquals(1,bill.peopleWhoFollowMe.size());
  mary=session.load(Person.class,idMary);
  assertEquals(1,mary.movieRatings.size());
  assertEquals(1,mary.peopleILike.size());
  assertEquals(2,mary.peopleWhoLikeMe.size());
  assertEquals(2,mary.peopleIFollow.size());
  assertEquals(1,mary.peopleWhoFollowMe.size());
  dieHard=session.load(Movie.class,idDieHard);
  matrix=session.load(Movie.class,idMatrix);
  assertEquals(3,matrix.ratings.size());
  assertEquals(2,dieHard.ratings.size());
  Person bob=new Person();
  bob.name="String_Node_Str";
  Rating ratingSix=Rating.create(bob,matrix,4);
  Rating ratingSeven=Rating.create(bob,matrix,5);
  bob.movieRatings.add(ratingSix);
  bob.movieRatings.add(ratingSeven);
  session.save(bob);
  session.clear();
  bob=session.load(Person.class,bob.id);
  assertEquals(2,bob.movieRatings.size());
}

Fixed version (ground truth):
/** 
 * @see DATAGRAPH-690
 */
@Test public void shouldCreateGraphProperly(){
  Person jim=new Person();
  Person mary=new Person();
  Person bill=new Person();
  jim.name="String_Node_Str";
  mary.name="String_Node_Str";
  bill.name="String_Node_Str";
  bill.peopleIFollow.add(jim);
  bill.peopleILike.add(mary);
  bill.peopleWhoFollowMe.add(mary);
  mary.peopleIFollow.add(bill);
  mary.peopleIFollow.add(jim);
  mary.peopleILike.add(jim);
  mary.peopleWhoLikeMe.add(bill);
  mary.peopleWhoFollowMe.add(jim);
  mary.peopleWhoLikeMe.add(jim);
  jim.peopleIFollow.add(mary);
  jim.peopleILike.add(mary);
  jim.peopleWhoFollowMe.add(bill);
  jim.peopleWhoFollowMe.add(mary);
  jim.peopleWhoLikeMe.add(mary);
  session.save(jim);
  Movie matrix=new Movie();
  matrix.name="String_Node_Str";
  Movie dieHard=new Movie();
  dieHard.name="String_Node_Str";
  Rating ratingOne=Rating.create(bill,matrix,4);
  Rating ratingTwo=Rating.create(bill,matrix,5);
  Rating ratingThree=Rating.create(jim,matrix,3);
  Rating ratingFour=Rating.create(jim,dieHard,5);
  Rating ratingFive=Rating.create(mary,dieHard,5);
  bill.movieRatings.add(ratingOne);
  matrix.ratings.add(ratingOne);
  bill.movieRatings.add(ratingTwo);
  matrix.ratings.add(ratingTwo);
  jim.movieRatings.add(ratingThree);
  matrix.ratings.add(ratingThree);
  jim.movieRatings.add(ratingFour);
  dieHard.ratings.add(ratingFour);
  mary.movieRatings.add(ratingFive);
  dieHard.ratings.add(ratingFive);
  session.save(bill);
  session.save(jim);
  session.save(mary);
  idDieHard=dieHard.id;
  idMatrix=matrix.id;
  idJim=jim.id;
  idBill=bill.id;
  idMary=mary.id;
  session.clear();
  jim=session.load(Person.class,idJim);
  assertEquals(2,jim.movieRatings.size());
  assertEquals(1,jim.peopleILike.size());
  assertEquals(1,jim.peopleWhoLikeMe.size());
  assertEquals(1,jim.peopleIFollow.size());
  assertEquals(2,jim.peopleWhoFollowMe.size());
  bill=session.load(Person.class,idBill);
  assertEquals(2,bill.movieRatings.size());
  assertEquals(1,bill.peopleILike.size());
  assertEquals(0,bill.peopleWhoLikeMe.size());
  assertEquals(1,bill.peopleIFollow.size());
  assertEquals(1,bill.peopleWhoFollowMe.size());
  mary=session.load(Person.class,idMary);
  assertEquals(1,mary.movieRatings.size());
  assertEquals(1,mary.peopleILike.size());
  assertEquals(2,mary.peopleWhoLikeMe.size());
  assertEquals(2,mary.peopleIFollow.size());
  assertEquals(1,mary.peopleWhoFollowMe.size());
  dieHard=session.load(Movie.class,idDieHard);
  matrix=session.load(Movie.class,idMatrix);
  assertEquals(3,matrix.ratings.size());
  assertEquals(2,dieHard.ratings.size());
  Person bob=new Person();
  bob.name="String_Node_Str";
  Rating ratingSix=Rating.create(bob,matrix,4);
  Rating ratingSeven=Rating.create(bob,matrix,5);
  bob.movieRatings.add(ratingSix);
  bob.movieRatings.add(ratingSeven);
  session.save(bob);
  session.clear();
  bob=session.load(Person.class,bob.id);
  assertEquals(2,bob.movieRatings.size());
}