### Question:
LDIFWriter implements Closeable { public void writeModifyDNChangeRecord(DN dn, RDN newRDN, boolean deleteOldRDN, DN newSuperior) throws IOException { ifNull(dn, newRDN); BufferedWriter writer = exportConfig.getWriter(); int wrapColumn = exportConfig.getWrapColumn(); boolean wrapLines = wrapColumn > 1; writeDN("dn", dn, writer, wrapLines, wrapColumn); String changeType = newSuperior == null ? "changetype: modrdn" : "changetype: moddn"; writeLDIFLine(new StringBuilder(changeType), writer, wrapLines, wrapColumn); StringBuilder rdnLine = new StringBuilder("newrdn"); appendLDIFSeparatorAndValue(rdnLine, ByteString.valueOfUtf8(newRDN.toString())); writeLDIFLine(rdnLine, writer, wrapLines, wrapColumn); StringBuilder deleteOldRDNLine = new StringBuilder(); deleteOldRDNLine.append("deleteoldrdn: "); deleteOldRDNLine.append(deleteOldRDN ? "1" : "0"); writeLDIFLine(deleteOldRDNLine, writer, wrapLines, wrapColumn); if (newSuperior != null) { writeDN("newsuperior", newSuperior, 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 = "writeModifyDNDataProvider") public void TestWriteModifyDNChangeRecord( ModifyDNChangeRecordEntry change, String[] expectedLDIF) throws Exception { Writer writer = new Writer(); LDIFWriter ldifWriter = writer.getLDIFWriter(); ldifWriter.writeModifyDNChangeRecord(change.getDN(), change.getNewRDN(), change.deleteOldRDN(), change .getNewSuperiorDN()); checkLDIFOutput(writer, expectedLDIF); }