### Question:
LDIFWriter implements Closeable { public void writeModifyChangeRecord(DN dn, List<Modification> modifications) throws IOException { ifNull(dn, modifications); if (modifications.isEmpty()) { return; } BufferedWriter writer = exportConfig.getWriter(); int wrapColumn = exportConfig.getWrapColumn(); boolean wrapLines = wrapColumn > 1; writeDN("dn", dn, writer, wrapLines, wrapColumn); StringBuilder changeTypeLine = new StringBuilder("changetype: modify"); writeLDIFLine(changeTypeLine, writer, wrapLines, wrapColumn); Iterator<Modification> iterator = modifications.iterator(); while (iterator.hasNext()) { Modification m = iterator.next(); Attribute a = m.getAttribute(); StringBuilder nameBuffer = new StringBuilder(a.getName()); for (String o : a.getOptions()) { nameBuffer.append(";"); nameBuffer.append(o); } String name = nameBuffer.toString(); StringBuilder modTypeLine = new StringBuilder(); modTypeLine.append(m.getModificationType()); modTypeLine.append(": "); modTypeLine.append(name); writeLDIFLine(modTypeLine, writer, wrapLines, wrapColumn); for (ByteString v : a) { writeAttribute(name, v, writer, wrapLines, wrapColumn); } if (iterator.hasNext()) { writer.write("-"); } 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 = "writeModifyDataProvider") public void TestWriteModifyChangeRecord(ModifyChangeRecordEntry change, String[] expectedLDIF) throws Exception { Writer writer = new Writer(); LDIFWriter ldifWriter = writer.getLDIFWriter(); List<Modification> mods = new LinkedList<>(); for (RawModification lmod : change.getModifications()) { mods.add(lmod.toModification()); } ldifWriter.writeModifyChangeRecord(change.getDN(), mods); checkLDIFOutput(writer, expectedLDIF); }