Price implements ByteTransformable { @Override public boolean equals(Object otherObject) { if (this == otherObject) return true; if (otherObject == null || !(otherObject instanceof Price)) return false; Price otherPrice = (Price) otherObject; return (this.getBase().equals(otherPrice.getBase()) && this.getQuote().equals(otherPrice.getQuote())); } @JsonCreator  Price(@JsonProperty("base") LegacyAsset base, @JsonProperty("quote") LegacyAsset quote); LegacyAsset getBase(); void setBase(LegacyAsset base); LegacyAsset getQuote(); void setQuote(LegacyAsset quote); LegacyAsset multiply(LegacyAsset asset); @Override byte[] toByteArray(); @Override String toString(); @Override boolean equals(Object otherObject); @Override int hashCode();  }
@Test public void testPriceEqualsMethod() { LegacyAsset base = new LegacyAsset(115, LegacyAssetSymbolType.SBD); LegacyAsset quote = new LegacyAsset(100, LegacyAssetSymbolType.STEEM); Price price = new Price(base, quote); LegacyAsset anotherBase = new LegacyAsset(115, LegacyAssetSymbolType.SBD); LegacyAsset anotherQuote = new LegacyAsset(100, LegacyAssetSymbolType.STEEM); Price anotherPrice = new Price(anotherBase, anotherQuote); LegacyAsset defferentBase = new LegacyAsset(115, LegacyAssetSymbolType.SBD); LegacyAsset differentQuote = new LegacyAsset(1230, LegacyAssetSymbolType.STEEM); Price differentPrice = new Price(defferentBase, differentQuote); assertThat(price.equals(anotherPrice), equalTo(true)); assertThat(anotherPrice.equals(differentPrice), equalTo(false)); }