### Question:
ModifyDNRequestProtocolOp extends ProtocolOp { public void write(ASN1Writer stream) throws IOException { stream.writeStartSequence(OP_TYPE_MODIFY_DN_REQUEST); stream.writeOctetString(entryDN); stream.writeOctetString(newRDN); stream.writeBoolean(deleteOldRDN); if(newSuperior != null) { stream.writeOctetString(TYPE_MODIFY_DN_NEW_SUPERIOR, newSuperior); } stream.writeEndSequence(); } ModifyDNRequestProtocolOp(ByteString entryDN,
                                   ByteString newRDN, boolean deleteOldRDN);  ModifyDNRequestProtocolOp(ByteString entryDN,
                                   ByteString newRDN, boolean deleteOldRDN,
                                   ByteString newSuperior); ByteString getEntryDN(); ByteString getNewRDN(); boolean deleteOldRDN(); ByteString getNewSuperior(); byte getType(); String getProtocolOpName(); void write(ASN1Writer stream); void toString(StringBuilder buffer); void toString(StringBuilder buffer, int indent);  }### Answer:
@Test(expectedExceptions = Exception.class) public void testNullEncodeDecode() throws Exception { ByteStringBuilder builder = new ByteStringBuilder(); ASN1Writer writer = ASN1.getWriter(builder); ModifyDNRequestProtocolOp modifyEncoded; ModifyDNRequestProtocolOp modifyDecoded; modifyEncoded = new ModifyDNRequestProtocolOp(null, null, true); modifyEncoded.write(writer); ASN1Reader reader = ASN1.getReader(builder.toByteString()); modifyDecoded = (ModifyDNRequestProtocolOp)LDAPReader.readProtocolOp(reader); }