### Question:
CompareRequestProtocolOp extends ProtocolOp { public void write(ASN1Writer stream) throws IOException { stream.writeStartSequence(OP_TYPE_COMPARE_REQUEST); stream.writeOctetString(dn); stream.writeStartSequence(); stream.writeOctetString(attributeType); stream.writeOctetString(assertionValue); stream.writeEndSequence(); stream.writeEndSequence(); } CompareRequestProtocolOp(ByteString dn, String attributeType,
                                  ByteString assertionValue); ByteString getDN(); String getAttributeType(); ByteString getAssertionValue(); 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); CompareRequestProtocolOp compareEncoded; CompareRequestProtocolOp compareDecoded; compareEncoded = new CompareRequestProtocolOp(null, null, null); compareEncoded.write(writer); ASN1Reader reader = ASN1.getReader(builder.toByteString()); compareDecoded = (CompareRequestProtocolOp)LDAPReader.readProtocolOp(reader); }