### Question:
PdfGiverAssignmentWriter implements GiverAssignmentWriter { @Override public void writeGiverAssignment(final String name, final GiverAssignment assignment, final OutputStream out, final String password) { try (Document document = new Document(PageSize.A5)) { handleMetaData(out, password, document); header.setAlignment(Element.ALIGN_CENTER); header.scalePercent(IMAGE_SCALE_PERCENTAGE); document.open(); document.add(header); addParagraph(document, assignment.getFrom().getName(), FONT_SIZE_MAIN, Font.BOLDITALIC, Color.BLACK); addParagraph(document, phrase, FONT_SIZE_MAIN, Font.ITALIC, Color.BLACK); addParagraph(document, assignment.getTo().getName(), FONT_SIZE_GIFT_RECEIVER, Font.BOLDITALIC, Color.RED); } catch (Exception e) { throw new SantaException(String.format("Unable to create PDF '%s'", name), e); } } PdfGiverAssignmentWriter(final I18nBundleProvider provider); @Override void writeGiverAssignment(final String name, final GiverAssignment assignment, final OutputStream out, final String password); @Override String getFormatSuffix(); static final String FORMAT_SUFFIX; }### Answer:
@Test public void testWrite() throws Exception { try (OutputStream out = Files.newOutputStream(file)) { GiverAssignment assignment = WriterTestTool.assignment("Albert", "Beryl"); target.writeGiverAssignment(file.toString(), assignment, out, "secret"); assertTrue(Files.size(file) > 0, "Output"); } }