### Question:
LDIFWriter implements Closeable { public void writeDeleteChangeRecord(Entry entry, boolean commentEntry) throws IOException { ifNull(entry); BufferedWriter writer = exportConfig.getWriter(); int wrapColumn = exportConfig.getWrapColumn(); boolean wrapLines = wrapColumn > 1; writeDN("dn", entry.getName(), writer, wrapLines, wrapColumn); StringBuilder changeTypeLine = new StringBuilder("changetype: delete"); writeLDIFLine(changeTypeLine, writer, wrapLines, wrapColumn); if (commentEntry) { for (String s : entry.getObjectClasses().values()) { StringBuilder ocLine = new StringBuilder(); ocLine.append("# objectClass: "); ocLine.append(s); writeLDIFLine(ocLine, writer, wrapLines, wrapColumn); } for (AttributeType attrType : entry.getUserAttributes().keySet()) { for (Attribute a : entry.getUserAttribute(attrType)) { StringBuilder attrName = new StringBuilder(); attrName.append("# "); attrName.append(a.getName()); for (String o : a.getOptions()) { attrName.append(";"); attrName.append(o); } for (ByteString v : a) { writeAttribute(attrName, v, writer, wrapLines, wrapColumn); } } } } writer.newLine(); } LDIFWriter(LDIFExportConfig exportConfig); void writeComment(LocalizableMessage comment, int wrapColumn); boolean writeEntries(Collection<Entry> entries); boolean writeEntry(Entry entry); boolean writeTemplateEntry(TemplateEntry templateEntry); void writeChangeRecord(ChangeRecordEntry changeRecord); void writeAddChangeRecord(Entry entry); void writeDeleteChangeRecord(Entry entry, boolean commentEntry); void writeModifyChangeRecord(DN dn, List<Modification> modifications); void writeModifyDNChangeRecord(DN dn, RDN newRDN, boolean deleteOldRDN,
                                        DN newSuperior); void flush(); @Override void close(); static void appendLDIFSeparatorAndValue(StringBuilder buffer,
                                                 ByteSequence valueBytes); static void appendLDIFSeparatorAndValue(StringBuilder buffer,
      ByteSequence valueBytes, boolean isURL, boolean isBase64); static void writeLDIFLine(StringBuilder line, BufferedWriter writer,
                                   boolean wrapLines, int wrapColumn);  }### Answer:
@Test(dataProvider = "entryDataProvider") public void TestWriteDeleteEntry(Entry entry) throws Exception { Writer writer = new Writer(); LDIFWriter ldifWriter = writer.getLDIFWriter(); ldifWriter.writeDeleteChangeRecord(entry, false); String[] expectedLDIF = new String[] { "dn: " + entry.getName(), "changetype: delete" }; checkLDIFOutput(writer, expectedLDIF); }