Program: 41908
Project: 41908
Buggy source:
@Test public void testDocumentCrud() throws DocumentClientException {
  DocumentClient client=new DocumentClient(HOST,MASTER_KEY,ConnectionPolicy.GetDefault(),ConsistencyLevel.Session);
  List<Document> documents=client.readDocuments(this.collectionForTest.getSelfLink(),null).getQueryIterable().toList();
  Assert.assertEquals(0,documents.size());
  Document documentDefinition=new Document("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  try {
    client.createDocument(this.collectionForTest.getSelfLink(),documentDefinition,null,true);
    Assert.fail("String_Node_Str");
  }
 catch (  DocumentClientException e) {
    Assert.assertEquals(400,e.getStatusCode());
    Assert.assertEquals("String_Node_Str",e.getError().getCode());
  }
  Document document=client.createDocument(this.collectionForTest.getSelfLink(),documentDefinition,null,false).getResource();
  Assert.assertEquals(documentDefinition.getString("String_Node_Str"),document.getString("String_Node_Str"));
  Assert.assertNotNull(document.getId());
  documents=client.readDocuments(this.collectionForTest.getSelfLink(),null).getQueryIterable().toList();
  Assert.assertEquals(1,documents.size());
  documents=client.queryDocuments(this.collectionForTest.getSelfLink(),new SqlQuerySpec("String_Node_Str",new SqlParameterCollection(new SqlParameter("String_Node_Str",documentDefinition.getString("String_Node_Str")))),null).getQueryIterable().toList();
  Assert.assertEquals(1,documents.size());
  document.set("String_Node_Str","String_Node_Str");
  document.set("String_Node_Str","String_Node_Str");
  Document replacedDocument=client.replaceDocument(document,null).getResource();
  Assert.assertEquals("String_Node_Str",replacedDocument.getString("String_Node_Str"));
  Assert.assertEquals("String_Node_Str",replacedDocument.getString("String_Node_Str"));
  Assert.assertEquals(document.getId(),replacedDocument.getId());
  Document oneDocumentFromRead=client.readDocument(replacedDocument.getSelfLink(),null).getResource();
  Assert.assertEquals(replacedDocument.getId(),oneDocumentFromRead.getId());
  AccessCondition accessCondition=new AccessCondition();
  accessCondition.setCondition(oneDocumentFromRead.getETag());
  accessCondition.setType(AccessConditionType.IfNoneMatch);
  RequestOptions options=new RequestOptions();
  options.setAccessCondition(accessCondition);
  ResourceResponse<Document> rr=client.readDocument(oneDocumentFromRead.getSelfLink(),options);
  Assert.assertEquals(rr.getStatusCode(),HttpStatus.SC_NOT_MODIFIED);
  client.deleteDocument(replacedDocument.getSelfLink(),null).close();
  try {
    client.readDocument(replacedDocument.getSelfLink(),null).close();
    Assert.fail("String_Node_Str");
  }
 catch (  DocumentClientException e) {
    Assert.assertEquals(404,e.getStatusCode());
    Assert.assertEquals("String_Node_Str",e.getError().getCode());
  }
}

Fixed version (ground truth):
@Test public void testDocumentCrud() throws DocumentClientException {
  DocumentClient client=new DocumentClient(HOST,MASTER_KEY,ConnectionPolicy.GetDefault(),ConsistencyLevel.Session);
  List<Document> documents=client.readDocuments(this.collectionForTest.getSelfLink(),null).getQueryIterable().toList();
  Assert.assertEquals(0,documents.size());
  Document documentDefinition=new Document("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  try {
    client.createDocument(this.collectionForTest.getSelfLink(),documentDefinition,null,true);
    Assert.fail("String_Node_Str");
  }
 catch (  DocumentClientException e) {
    Assert.assertEquals(400,e.getStatusCode());
    Assert.assertEquals("String_Node_Str",e.getError().getCode());
  }
  Document document=client.createDocument(this.collectionForTest.getSelfLink(),documentDefinition,null,false).getResource();
  Assert.assertEquals(documentDefinition.getString("String_Node_Str"),document.getString("String_Node_Str"));
  Assert.assertEquals(documentDefinition.getString("String_Node_Str"),document.getString("String_Node_Str"));
  Assert.assertEquals(documentDefinition.getString("String_Node_Str"),document.getString("String_Node_Str"));
  Assert.assertNotNull(document.getId());
  documents=client.readDocuments(this.collectionForTest.getSelfLink(),null).getQueryIterable().toList();
  Assert.assertEquals(1,documents.size());
  documents=client.queryDocuments(this.collectionForTest.getSelfLink(),new SqlQuerySpec("String_Node_Str",new SqlParameterCollection(new SqlParameter("String_Node_Str",documentDefinition.getString("String_Node_Str")))),null).getQueryIterable().toList();
  Assert.assertEquals(1,documents.size());
  document.set("String_Node_Str","String_Node_Str");
  document.set("String_Node_Str","String_Node_Str");
  Document replacedDocument=client.replaceDocument(document,null).getResource();
  Assert.assertEquals("String_Node_Str",replacedDocument.getString("String_Node_Str"));
  Assert.assertEquals("String_Node_Str",replacedDocument.getString("String_Node_Str"));
  Assert.assertEquals(document.getId(),replacedDocument.getId());
  Document oneDocumentFromRead=client.readDocument(replacedDocument.getSelfLink(),null).getResource();
  Assert.assertEquals(replacedDocument.getId(),oneDocumentFromRead.getId());
  AccessCondition accessCondition=new AccessCondition();
  accessCondition.setCondition(oneDocumentFromRead.getETag());
  accessCondition.setType(AccessConditionType.IfNoneMatch);
  RequestOptions options=new RequestOptions();
  options.setAccessCondition(accessCondition);
  ResourceResponse<Document> rr=client.readDocument(oneDocumentFromRead.getSelfLink(),options);
  Assert.assertEquals(rr.getStatusCode(),HttpStatus.SC_NOT_MODIFIED);
  client.deleteDocument(replacedDocument.getSelfLink(),null).close();
  try {
    client.readDocument(replacedDocument.getSelfLink(),null).close();
    Assert.fail("String_Node_Str");
  }
 catch (  DocumentClientException e) {
    Assert.assertEquals(404,e.getStatusCode());
    Assert.assertEquals("String_Node_Str",e.getError().getCode());
  }
}