### Question:
DexTransferMoneyTransaction extends DEX { @Override public AbstractAttachment parseAttachment(ByteBuffer buffer) throws AplException.NotValidException { return new DexControlOfFrozenMoneyAttachment(buffer); }  @Override byte getSubtype(); @Override LedgerEvent getLedgerEvent(); @Override AbstractAttachment parseAttachment(ByteBuffer buffer); @Override AbstractAttachment parseAttachment(JSONObject attachmentData); @Override void validateAttachment(Transaction transaction); @Override boolean applyAttachmentUnconfirmed(Transaction transaction, Account senderAccount); @Override void applyAttachment(Transaction tx, Account sender, Account recipient); @Override void undoAttachmentUnconfirmed(Transaction transaction, Account senderAccount); @Override boolean isDuplicate(Transaction transaction, Map<TransactionType, Map<String, Integer>> duplicates); @Override boolean canHaveRecipient(); @Override boolean isPhasingSafe(); @Override String getName();  }### Answer:
@Test void testSerializeDeserializeAttachmentToJson() throws AplException.NotValidException { JSONObject jsonObject = attachment.getJSONObject(); AbstractAttachment parsedAttachment = transactionType.parseAttachment(jsonObject); assertEquals(attachment, parsedAttachment); }
@Test void parseByteAttachment() throws AplException.NotValidException { ByteBuffer buffer = ByteBuffer.allocate(17); buffer.put((byte) 1); buffer.putLong(64); buffer.putLong(100); buffer.rewind(); AbstractAttachment parsedAttachment = transactionType.parseAttachment(buffer); assertEquals(attachment, parsedAttachment); }
@Test void testJsonParseAttachment() throws AplException.NotValidException { JSONObject jsonObject = new JSONObject(); jsonObject.put("contractId", 64L); jsonObject.put("offerAmount", 100L); jsonObject.put("version.DexTransferMoney", 1); AbstractAttachment parsedAttachment = transactionType.parseAttachment(jsonObject); assertEquals(attachment, parsedAttachment); }
@Test void testSerializeDeserializeAttachmentToByteBuffer() throws AplException.NotValidException { int myFullSize = attachment.getFullSize(); ByteBuffer buffer = ByteBuffer.allocate(myFullSize); attachment.putBytes(buffer); buffer.rewind(); AbstractAttachment parsedAttachment = transactionType.parseAttachment(buffer); assertEquals(attachment, parsedAttachment); }