LegacyAsset implements ByteTransformable { @Override public boolean equals(Object otherAsset) { if (this == otherAsset) return true; if (otherAsset == null || !(otherAsset instanceof LegacyAsset)) return false; LegacyAsset other = (LegacyAsset) otherAsset; return (this.getAmount().equals(other.getAmount()) && this.getSymbol().equals(other.getSymbol()) && this.getPrecision().equals(other.getPrecision())); } LegacyAsset(BigDecimal amount, LegacyAssetSymbolType symbol);  LegacyAsset(long amount, LegacyAssetSymbolType symbol); Long getAmount(); Integer getPrecision(); LegacyAssetSymbolType getSymbol(); void setAmount(long amount); void setAmount(BigDecimal amount); void setSymbol(LegacyAssetSymbolType symbol); BigDecimal toReal(); @Override byte[] toByteArray(); @Override String toString(); @Override boolean equals(Object otherAsset); @Override int hashCode();  }
@Test public void testAssetEqualsMethod() { LegacyAsset asset = new LegacyAsset(115, LegacyAssetSymbolType.SBD); LegacyAsset sameAsset = new LegacyAsset(new BigDecimal("0.115"), LegacyAssetSymbolType.SBD); LegacyAsset differentAsset = new LegacyAsset(100, LegacyAssetSymbolType.STEEM); assertThat(asset.equals(sameAsset), equalTo(true)); assertThat(sameAsset.equals(differentAsset), equalTo(false)); }