### Question:
DocumentBuilder { public Document createDocument(Collection<Field> fields) { Document document = new Document(); for (Field field : fields) { document.add(field); } return document; } DocumentBuilder(); Document createDocument(Collection<Field> fields);  }### Answer:
@Test public void testCreateDocument() throws CASException, IOException{ Document document = documentBuilder.createDocument(fields); assertEquals(field1, document.getField("field1")); assertEquals(field2, document.getField("field2")); }