### Question:
DeleteVariantOp extends Op { @Override public byte[] encode() throws IOException { ByteArrayOutputStream os = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(os)) { dos.writeByte(Op.DELETE); dos.writeLong(variantSpan.start); dos.writeLong(variantSpan.width); } os.flush(); return os.toByteArray(); } DeleteVariantOp(DataInputStream dis);  DeleteVariantOp(VariantSpan variantSpan); @Override byte[] encode(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); final VariantSpan variantSpan; }### Answer:
@Test public void encode() throws Exception { DeleteVariantOp op = new DeleteVariantOp(new VariantSpan(1, 100)); byte[] data = op.encode(); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); assertEquals(Op.DELETE, dis.read()); assertEquals(1, dis.readLong()); assertEquals(100, dis.readLong()); }