Program: 93543
Project: 93543
Buggy source:
/** 
 * Setup the test checking the implication between conflicts. This setup will assert that the dependencies of all the diffs are correct, then return the exact diff to test in order to validate the point.
 * @return the diff we want to check
 * @throws IOException
 */
private Diff setupImplicationBetweenConflicts() throws IOException {
  final Resource origin=input.getConflictAndPseudoConflictImplicationsAncestor();
  final Resource left=input.getConflictAndPseudoConflictImplicationsLeft();
  final Resource right=input.getConflictAndPseudoConflictImplicationsRight();
  MergeDependenciesChecker checker=null;
  final IComparisonScope scope=new DefaultComparisonScope(left,right,origin);
  Comparison comparison=EMFCompare.builder().build().compare(scope);
  EList<Conflict> conflicts=comparison.getConflicts();
  EList<Diff> differences=comparison.getDifferences();
  assertEquals(9,comparison.getDifferences().size());
  assertEquals(4,conflicts.size());
  Collection<Conflict> pseudoConflicts=Collections2.filter(conflicts,EMFComparePredicates.containsConflictOfTypes(PSEUDO));
  Collection<Conflict> realConflicts=Collections2.filter(conflicts,EMFComparePredicates.containsConflictOfTypes(REAL));
  assertEquals(2,pseudoConflicts.size());
  assertEquals(2,realConflicts.size());
  Conflict pseudo1=null;
  Conflict pseudo2=null;
  for (  Conflict conflict : pseudoConflicts) {
    if (conflict.getLeftDifferences().get(0).getMatch().getOrigin().toString().contains("String_Node_Str")) {
      pseudo1=conflict;
    }
 else     if (conflict.getLeftDifferences().get(0).getMatch().getOrigin().toString().contains("String_Node_Str")) {
      pseudo2=conflict;
    }
  }
  assertNotNull(pseudo1);
  assertNotNull(pseudo2);
  Conflict real1=null;
  Conflict real2=null;
  for (  Conflict conflict : realConflicts) {
    if (conflict.getLeftDifferences().get(0).getMatch().getDifferences().size() == 1) {
      real2=conflict;
    }
 else     if (conflict.getLeftDifferences().get(0).getMatch().getDifferences().size() == 2) {
      real1=conflict;
    }
  }
  assertNotNull(real1);
  assertNotNull(real2);
  Collection<Diff> conflict1FromLeft=Collections2.filter(real1.getDifferences(),fromSide(LEFT));
  Collection<Diff> conflict1FromRight=Collections2.filter(real1.getDifferences(),fromSide(RIGHT));
  assertEquals(1,conflict1FromLeft.size());
  assertEquals(1,conflict1FromRight.size());
  Collection<Diff> conflict2FromLeft=Collections2.filter(real2.getDifferences(),fromSide(LEFT));
  Collection<Diff> conflict2FromRight=Collections2.filter(real2.getDifferences(),fromSide(RIGHT));
  assertEquals(1,conflict2FromLeft.size());
  assertEquals(1,conflict2FromRight.size());
  Diff deleteClassB=conflict1FromLeft.iterator().next();
  differences.remove(deleteClassB);
  Diff renameClassB=conflict1FromRight.iterator().next();
  differences.remove(renameClassB);
  Diff deletePackageA=conflict2FromLeft.iterator().next();
  differences.remove(deletePackageA);
  Diff renamePackageA=conflict2FromRight.iterator().next();
  differences.remove(renamePackageA);
  for (  Diff diff : pseudo1.getDifferences()) {
    differences.remove(diff);
    checker=getChecker(diff);
    if (diff.getSource() == DifferenceSource.LEFT) {
      checker.rightToLeft().implies(7).rejects(0).check();
      checker.leftToRight().implies(2).rejects(0).check();
    }
 else {
      checker.rightToLeft().implies(2).rejects(0).check();
      checker.leftToRight().implies(7).rejects(0).check();
    }
  }
  for (  Diff diff : pseudo2.getDifferences()) {
    differences.remove(diff);
    checker=getChecker(diff);
    if (diff.getSource() == DifferenceSource.LEFT) {
      checker.rightToLeft().implies(3).rejects(0).check();
      checker.leftToRight().implies(4).rejects(0).check();
    }
 else {
      checker.rightToLeft().implies(4).rejects(0).check();
      checker.leftToRight().implies(3).rejects(0).check();
    }
  }
  checker=getChecker(deleteClassB);
  checker.rightToLeft().implies(2).rejects(0).check();
  checker.leftToRight().implies(3).rejects(1).check();
  checker=getChecker(renameClassB);
  checker.rightToLeft().implies(1).rejects(2).check();
  checker.leftToRight().implies(1).rejects(0).check();
  checker=getChecker(deletePackageA);
  checker.rightToLeft().implies(1).rejects(0).check();
  checker.leftToRight().implies(4).rejects(2).check();
  checker=getChecker(renamePackageA);
  checker.rightToLeft().implies(1).rejects(1).check();
  checker.leftToRight().implies(1).rejects(0).check();
  assertEquals(1,differences.size());
  return differences.get(0);
}

Fixed version (ground truth):
/** 
 * Setup the test checking the implication between conflicts. This setup will assert that the dependencies of all the diffs are correct, then return the exact diff to test in order to validate the point.
 * @return the diff we want to check
 * @throws IOException
 */
private Diff setupImplicationBetweenConflicts() throws IOException {
  final Resource origin=input.getConflictAndPseudoConflictImplicationsAncestor();
  final Resource left=input.getConflictAndPseudoConflictImplicationsLeft();
  final Resource right=input.getConflictAndPseudoConflictImplicationsRight();
  MergeDependenciesChecker checker=null;
  final IComparisonScope scope=new DefaultComparisonScope(left,right,origin);
  Comparison comparison=EMFCompare.builder().build().compare(scope);
  EList<Conflict> conflicts=comparison.getConflicts();
  EList<Diff> differences=comparison.getDifferences();
  assertEquals(9,comparison.getDifferences().size());
  assertEquals(4,conflicts.size());
  Collection<Conflict> pseudoConflicts=Collections2.filter(conflicts,EMFComparePredicates.containsConflictOfTypes(PSEUDO));
  Collection<Conflict> realConflicts=Collections2.filter(conflicts,EMFComparePredicates.containsConflictOfTypes(REAL));
  assertEquals(2,pseudoConflicts.size());
  assertEquals(2,realConflicts.size());
  Conflict pseudo1=null;
  Conflict pseudo2=null;
  for (  Conflict conflict : pseudoConflicts) {
    if (conflict.getLeftDifferences().get(0).getMatch().getOrigin().toString().contains("String_Node_Str")) {
      pseudo1=conflict;
    }
 else     if (conflict.getLeftDifferences().get(0).getMatch().getOrigin().toString().contains("String_Node_Str")) {
      pseudo2=conflict;
    }
  }
  assertNotNull(pseudo1);
  assertNotNull(pseudo2);
  Conflict real1=null;
  Conflict real2=null;
  for (  Conflict conflict : realConflicts) {
    if (conflict.getLeftDifferences().get(0).getMatch().getDifferences().size() == 1) {
      real2=conflict;
    }
 else     if (conflict.getLeftDifferences().get(0).getMatch().getDifferences().size() == 2) {
      real1=conflict;
    }
  }
  assertNotNull(real1);
  assertNotNull(real2);
  Collection<Diff> conflict1FromLeft=Collections2.filter(real1.getDifferences(),fromSide(LEFT));
  Collection<Diff> conflict1FromRight=Collections2.filter(real1.getDifferences(),fromSide(RIGHT));
  assertEquals(1,conflict1FromLeft.size());
  assertEquals(1,conflict1FromRight.size());
  Collection<Diff> conflict2FromLeft=Collections2.filter(real2.getDifferences(),fromSide(LEFT));
  Collection<Diff> conflict2FromRight=Collections2.filter(real2.getDifferences(),fromSide(RIGHT));
  assertEquals(1,conflict2FromLeft.size());
  assertEquals(1,conflict2FromRight.size());
  Diff deleteClassB=conflict1FromLeft.iterator().next();
  differences.remove(deleteClassB);
  Diff renameClassB=conflict1FromRight.iterator().next();
  differences.remove(renameClassB);
  Diff deletePackageA=conflict2FromLeft.iterator().next();
  differences.remove(deletePackageA);
  Diff renamePackageA=conflict2FromRight.iterator().next();
  differences.remove(renamePackageA);
  for (  Diff diff : pseudo1.getDifferences()) {
    differences.remove(diff);
    checker=getChecker(diff);
    if (diff.getSource() == DifferenceSource.LEFT) {
      checker.rightToLeft().implies(4).rejects(0).check();
      checker.leftToRight().implies(2).rejects(0).check();
    }
 else {
      checker.rightToLeft().implies(2).rejects(0).check();
      checker.leftToRight().implies(2).rejects(0).check();
    }
  }
  for (  Diff diff : pseudo2.getDifferences()) {
    differences.remove(diff);
    checker=getChecker(diff);
    if (diff.getSource() == DifferenceSource.LEFT) {
      checker.rightToLeft().implies(3).rejects(0).check();
      checker.leftToRight().implies(2).rejects(0).check();
    }
 else {
      checker.rightToLeft().implies(2).rejects(0).check();
      checker.leftToRight().implies(2).rejects(0).check();
    }
  }
  checker=getChecker(deleteClassB);
  checker.rightToLeft().implies(2).rejects(0).check();
  checker.leftToRight().implies(1).rejects(1).check();
  checker=getChecker(renameClassB);
  checker.rightToLeft().implies(1).rejects(2).check();
  checker.leftToRight().implies(1).rejects(0).check();
  checker=getChecker(deletePackageA);
  checker.rightToLeft().implies(1).rejects(0).check();
  checker.leftToRight().implies(2).rejects(2).check();
  checker=getChecker(renamePackageA);
  checker.rightToLeft().implies(1).rejects(1).check();
  checker.leftToRight().implies(1).rejects(0).check();
  assertEquals(1,differences.size());
  return differences.get(0);
}