Program: 17814
Project: 17814
Buggy source:
@Test public void testContentIdReferencing() throws Exception {
  List<BatchPart> batch=new ArrayList<BatchPart>();
  BatchChangeSet changeSet=BatchChangeSet.newBuilder().build();
  Map<String,String> changeSetHeaders=new HashMap<String,String>();
  changeSetHeaders.put("String_Node_Str","String_Node_Str");
  changeSetHeaders.put("String_Node_Str","String_Node_Str");
  BatchChangeSetPart changeRequest=BatchChangeSetPart.method(POST).uri("String_Node_Str").contentId("String_Node_Str").body("String_Node_Str").headers(changeSetHeaders).build();
  changeSet.add(changeRequest);
  changeSetHeaders=new HashMap<String,String>();
  changeSetHeaders.put("String_Node_Str","String_Node_Str");
  BatchChangeSetPart changeRequest2=BatchChangeSetPart.method(PUT).uri("String_Node_Str").contentId("String_Node_Str").body("String_Node_Str").headers(changeSetHeaders).build();
  changeSet.add(changeRequest2);
  batch.add(changeSet);
  Map<String,String> getRequestHeaders=new HashMap<String,String>();
  getRequestHeaders.put("String_Node_Str","String_Node_Str");
  BatchPart request=BatchQueryPart.method(GET).uri("String_Node_Str").contentId("String_Node_Str").headers(getRequestHeaders).build();
  batch.add(request);
  InputStream body=EntityProvider.writeBatchRequestBody(batch,BOUNDARY);
  String bodyAsString=StringHelper.inputStreamToString(body,true);
  checkMimeHeaders(bodyAsString);
  checkBoundaryDelimiters(bodyAsString);
  assertTrue(bodyAsString.contains("String_Node_Str"));
  assertTrue(bodyAsString.contains("String_Node_Str"));
  assertTrue(bodyAsString.contains("String_Node_Str"));
  HttpResponse batchResponse=execute(bodyAsString);
  InputStream responseBody=batchResponse.getEntity().getContent();
  String contentType=batchResponse.getFirstHeader(HttpHeaders.CONTENT_TYPE).getValue();
  List<BatchSingleResponse> responses=EntityProvider.parseBatchResponse(responseBody,contentType);
  for (  BatchSingleResponse response : responses) {
    if ("String_Node_Str".equals(response.getContentId())) {
      assertEquals("String_Node_Str",response.getStatusCode());
      assertEquals("String_Node_Str",response.getStatusInfo());
    }
 else     if ("String_Node_Str".equals(response.getContentId())) {
      assertEquals("String_Node_Str",response.getStatusCode());
      assertEquals("String_Node_Str",response.getStatusInfo());
    }
 else     if ("String_Node_Str".equals(response.getContentId())) {
      assertEquals("String_Node_Str",response.getStatusCode());
      assertEquals("String_Node_Str",response.getStatusInfo());
    }
 else {
      fail();
    }
  }
}

Fixed version (ground truth):
@Test public void testContentIdReferencing() throws Exception {
  List<BatchPart> batch=new ArrayList<BatchPart>();
  BatchChangeSet changeSet=BatchChangeSet.newBuilder().build();
  Map<String,String> changeSetHeaders=new HashMap<String,String>();
  changeSetHeaders.put("String_Node_Str","String_Node_Str");
  changeSetHeaders.put("String_Node_Str","String_Node_Str");
  BatchChangeSetPart changeRequest=BatchChangeSetPart.method(POST).uri("String_Node_Str").contentId("String_Node_Str").body("String_Node_Str").headers(changeSetHeaders).build();
  changeSet.add(changeRequest);
  changeSetHeaders=new HashMap<String,String>();
  changeSetHeaders.put("String_Node_Str","String_Node_Str");
  BatchChangeSetPart changeRequest2=BatchChangeSetPart.method(PUT).uri("String_Node_Str").contentId("String_Node_Str").body("String_Node_Str").headers(changeSetHeaders).build();
  changeSet.add(changeRequest2);
  batch.add(changeSet);
  Map<String,String> getRequestHeaders=new HashMap<String,String>();
  getRequestHeaders.put("String_Node_Str","String_Node_Str");
  BatchPart request=BatchQueryPart.method(GET).uri("String_Node_Str").contentId("String_Node_Str").headers(getRequestHeaders).build();
  batch.add(request);
  InputStream body=EntityProvider.writeBatchRequest(batch,BOUNDARY);
  String bodyAsString=StringHelper.inputStreamToString(body,true);
  checkMimeHeaders(bodyAsString);
  checkBoundaryDelimiters(bodyAsString);
  assertTrue(bodyAsString.contains("String_Node_Str"));
  assertTrue(bodyAsString.contains("String_Node_Str"));
  assertTrue(bodyAsString.contains("String_Node_Str"));
  HttpResponse batchResponse=execute(bodyAsString);
  InputStream responseBody=batchResponse.getEntity().getContent();
  String contentType=batchResponse.getFirstHeader(HttpHeaders.CONTENT_TYPE).getValue();
  List<BatchSingleResponse> responses=EntityProvider.parseBatchResponse(responseBody,contentType);
  for (  BatchSingleResponse response : responses) {
    if ("String_Node_Str".equals(response.getContentId())) {
      assertEquals("String_Node_Str",response.getStatusCode());
      assertEquals("String_Node_Str",response.getStatusInfo());
    }
 else     if ("String_Node_Str".equals(response.getContentId())) {
      assertEquals("String_Node_Str",response.getStatusCode());
      assertEquals("String_Node_Str",response.getStatusInfo());
    }
 else     if ("String_Node_Str".equals(response.getContentId())) {
      assertEquals("String_Node_Str",response.getStatusCode());
      assertEquals("String_Node_Str",response.getStatusInfo());
    }
 else {
      fail();
    }
  }
}