Program: 24952
Project: 24952
Buggy source:
@Override public EventArgScoringAlignment<EquivClassType> align(final AnswerKey answerKey,final SystemOutput systemOutput){
  checkArgument(answerKey.docId() == systemOutput.docId());
  final ImmutableMultimap<EquivClassType,Response> equivClassToSystemResponses=Multimaps.index(systemOutput.responses(),equivClassFunction);
  final ImmutableMultimap<EquivClassType,AssessedResponse> equivClassToAnswerKeyResponses=Multimaps.index(answerKey.annotatedResponses(),Functions.compose(equivClassFunction,AssessedResponse.Response));
  final ImmutableSet<EquivClassType> allEquivClasses=Sets.union(equivClassToSystemResponses.keySet(),equivClassToAnswerKeyResponses.keySet()).immutableCopy();
  final ImmutableSet.Builder<EquivClassType> truePositives=ImmutableSet.builder();
  final ImmutableSet.Builder<EquivClassType> falsePositives=ImmutableSet.builder();
  final ImmutableSet.Builder<EquivClassType> falseNegatives=ImmutableSet.builder();
  final ImmutableSet.Builder<EquivClassType> unassessed=ImmutableSet.builder();
  for (  final EquivClassType eqivClass : allEquivClasses) {
    final ImmutableCollection<AssessedResponse> answerKeyResponsesForEC=equivClassToAnswerKeyResponses.get(eqivClass);
    final boolean isCorrectEquivClass=!FluentIterable.from(answerKeyResponsesForEC).filter(AssessedResponse.IsCorrectUpToInexactJustifications).isEmpty();
    final ImmutableCollection<Response> systemResponsesForEC=equivClassToSystemResponses.get(eqivClass);
    if (isCorrectEquivClass) {
      final Optional<Response> selectedSystemResponse=systemOutput.selectFromMultipleSystemResponses(equivClassToSystemResponses.get(eqivClass));
      if (selectedSystemResponse.isPresent()) {
        final Optional<AssessedResponse> assessmentOfSelectedResponse=AssessedResponse.findAnnotationForArgument(selectedSystemResponse.get(),answerKeyResponsesForEC);
        if (assessmentOfSelectedResponse.isPresent()) {
          if (assessmentOfSelectedResponse.get().isCorrectUpToInexactJustifications()) {
            truePositives.add(eqivClass);
          }
 else {
            falseNegatives.add(eqivClass);
          }
        }
 else {
          unassessed.add(eqivClass);
        }
      }
 else {
        falseNegatives.add(eqivClass);
      }
    }
 else {
      if (!systemResponsesForEC.isEmpty()) {
        falsePositives.add(eqivClass);
      }
 else {
      }
    }
  }
  return EventArgScoringAlignment.create(systemOutput.docId(),truePositives.build(),falsePositives.build(),falseNegatives.build(),unassessed.build(),equivClassToAnswerKeyResponses,equivClassToSystemResponses);
}

Fixed version (ground truth):
@Override public EventArgScoringAlignment<EquivClassType> align(final AnswerKey answerKey,final SystemOutput systemOutput){
  checkArgument(answerKey.docId() == systemOutput.docId());
  final ImmutableMultimap<EquivClassType,Response> equivClassToSystemResponses=Multimaps.index(systemOutput.responses(),equivClassFunction);
  final ImmutableMultimap<EquivClassType,AssessedResponse> equivClassToAnswerKeyResponses=Multimaps.index(answerKey.annotatedResponses(),Functions.compose(equivClassFunction,AssessedResponse.Response));
  final ImmutableSet<EquivClassType> allEquivClasses=Sets.union(equivClassToSystemResponses.keySet(),equivClassToAnswerKeyResponses.keySet()).immutableCopy();
  final ImmutableSet.Builder<EquivClassType> truePositives=ImmutableSet.builder();
  final ImmutableSet.Builder<EquivClassType> falsePositives=ImmutableSet.builder();
  final ImmutableSet.Builder<EquivClassType> falseNegatives=ImmutableSet.builder();
  final ImmutableSet.Builder<EquivClassType> unassessed=ImmutableSet.builder();
  for (  final EquivClassType eqivClass : allEquivClasses) {
    final ImmutableCollection<AssessedResponse> answerKeyResponsesForEC=equivClassToAnswerKeyResponses.get(eqivClass);
    final boolean isCorrectEquivClass=!FluentIterable.from(answerKeyResponsesForEC).filter(AssessedResponse.IsCorrectUpToInexactJustifications).isEmpty();
    final ImmutableCollection<Response> systemResponsesForEC=equivClassToSystemResponses.get(eqivClass);
    if (isCorrectEquivClass) {
      final Optional<Response> selectedSystemResponse=systemOutput.selectFromMultipleSystemResponses(equivClassToSystemResponses.get(eqivClass));
      if (selectedSystemResponse.isPresent()) {
        final Optional<AssessedResponse> assessmentOfSelectedResponse=AssessedResponse.findAnnotationForArgument(selectedSystemResponse.get(),answerKeyResponsesForEC);
        if (assessmentOfSelectedResponse.isPresent()) {
          if (assessmentOfSelectedResponse.get().isCorrectUpToInexactJustifications()) {
            truePositives.add(eqivClass);
          }
 else {
            falseNegatives.add(eqivClass);
            falsePositives.add(eqivClass);
          }
        }
 else {
          unassessed.add(eqivClass);
        }
      }
 else {
        falseNegatives.add(eqivClass);
      }
    }
 else {
      if (!systemResponsesForEC.isEmpty()) {
        falsePositives.add(eqivClass);
      }
 else {
      }
    }
  }
  return EventArgScoringAlignment.create(systemOutput.docId(),truePositives.build(),falsePositives.build(),falseNegatives.build(),unassessed.build(),equivClassToAnswerKeyResponses,equivClassToSystemResponses);
}