Program: 24883
Project: 24883
Buggy source:
public ScoringData transform(final ScoringData input){
  checkArgument(input.answerKey().isPresent() && input.argumentOutput().isPresent(),"String_Node_Str" + "String_Node_Str");
  assertRealisIsNeutralized(input);
  final AnswerKey answerKey=input.answerKey().get();
  final ArgumentOutput argumentOutput=input.argumentOutput().get();
  final ImmutableMultimap<String,AssessedResponse> answerKeyByTypeRoleBaseFiller=Multimaps.index(filter(answerKey.annotatedResponses(),AssessedResponse.IsCorrectUpToInexactJustifications),Functions.compose(TypeRoleBaseFiller,response()));
  final ImmutableMultimap<String,AssessedResponse> answerKeyByTypeRole=Multimaps.index(filter(answerKey.annotatedResponses(),AssessedResponse.IsCorrectUpToInexactJustifications),Functions.compose(TypeRole,response()));
  final ImmutableMap.Builder<Response,Response> responseReplacements=ImmutableMap.builder();
  final ImmutableSet.Builder<Response> toDelete=ImmutableSet.builder();
  for (  final Response response : argumentOutput.responses()) {
    final AssessedResponse assessedResponse=answerKey.assess(response).get();
    if (FieldAssessment.isAcceptable(assessedResponse.assessment().baseFillerCorrect()) && !FieldAssessment.isAcceptable(assessedResponse.assessment().entityCorrectFiller())) {
      final Collection<AssessedResponse> correctPoolResponsesSharingSameTypeRoleBF=answerKeyByTypeRoleBaseFiller.get(TypeRoleBaseFiller.apply(response));
      if (!correctPoolResponsesSharingSameTypeRoleBF.isEmpty()) {
        responseReplacements.put(response,Iterables.getFirst(correctPoolResponsesSharingSameTypeRoleBF,null).response());
        ++swappedCASForSameBF;
      }
 else {
        final Collection<AssessedResponse> correctPoolResponsesSharingSameTypeRole=answerKeyByTypeRole.get(TypeRole.apply(response));
        if (!correctPoolResponsesSharingSameTypeRole.isEmpty()) {
          responseReplacements.put(response,Iterables.getFirst(correctPoolResponsesSharingSameTypeRole,null).response());
          ++swappedCASDifferentBF;
        }
 else {
          toDelete.add(response);
          ++deleted;
        }
      }
    }
 else {
      ++passedThrough;
    }
  }
  final ResponseMapping responseMapping=ResponseMapping.create(responseReplacements.build(),toDelete.build());
  if (!responseMapping.isIdentity()) {
    log.info("String_Node_Str",responseMapping.summaryString());
  }
  final ScoringData.Builder ret=ScoringData.builder().from(input);
  ret.argumentOutput(responseMapping.apply(argumentOutput));
  if (input.systemLinking().isPresent()) {
    ret.systemLinking(responseMapping.apply(input.systemLinking().get()));
  }
  return ret.build();
}

Fixed version (ground truth):
@Override public ScoringData transform(final ScoringData input){
  checkArgument(input.answerKey().isPresent() && input.argumentOutput().isPresent(),"String_Node_Str" + "String_Node_Str");
  assertRealisIsNeutralized(input);
  final AnswerKey answerKey=input.answerKey().get();
  final ArgumentOutput argumentOutput=input.argumentOutput().get();
  final ImmutableMultimap<String,AssessedResponse> answerKeyByTypeRoleBaseFiller=Multimaps.index(filter(answerKey.annotatedResponses(),AssessedResponse.IsCorrectUpToInexactJustifications),Functions.compose(TypeRoleBaseFiller,response()));
  final ImmutableMultimap<String,AssessedResponse> answerKeyByTypeRole=Multimaps.index(filter(answerKey.annotatedResponses(),AssessedResponse.IsCorrectUpToInexactJustifications),Functions.compose(TypeRole,response()));
  final ImmutableMap.Builder<Response,Response> responseReplacements=ImmutableMap.builder();
  final ImmutableSet.Builder<Response> toDelete=ImmutableSet.builder();
  for (  final Response response : argumentOutput.responses()) {
    final AssessedResponse assessedResponse=answerKey.assess(response).get();
    if (FieldAssessment.isAcceptable(assessedResponse.assessment().baseFillerCorrect()) && !FieldAssessment.isAcceptable(assessedResponse.assessment().entityCorrectFiller())) {
      final Collection<AssessedResponse> correctPoolResponsesSharingSameTypeRoleBF=answerKeyByTypeRoleBaseFiller.get(TypeRoleBaseFiller.apply(response));
      if (!correctPoolResponsesSharingSameTypeRoleBF.isEmpty()) {
        responseReplacements.put(response,Iterables.getFirst(correctPoolResponsesSharingSameTypeRoleBF,null).response());
        ++swappedCASForSameBF;
      }
 else {
        final Collection<AssessedResponse> correctPoolResponsesSharingSameTypeRole=answerKeyByTypeRole.get(TypeRole.apply(response));
        if (!correctPoolResponsesSharingSameTypeRole.isEmpty()) {
          responseReplacements.put(response,Iterables.getFirst(correctPoolResponsesSharingSameTypeRole,null).response());
          ++swappedCASDifferentBF;
        }
 else {
          toDelete.add(response);
          ++deleted;
        }
      }
    }
 else {
      ++passedThrough;
    }
  }
  final ResponseMapping responseMapping=ResponseMapping.create(responseReplacements.build(),toDelete.build());
  if (!responseMapping.isIdentity()) {
    log.info("String_Node_Str",responseMapping.summaryString());
  }
  final ScoringData.Builder ret=ScoringData.builder().from(input);
  ret.argumentOutput(responseMapping.apply(argumentOutput));
  if (input.systemLinking().isPresent()) {
    ret.systemLinking(responseMapping.apply(input.systemLinking().get()));
  }
  return ret.build();
}