use of com.hedera.services.utils.EntityNumPair in project hedera-services by hashgraph.
the class MerkleUniqueTokenTest method equalsContractWorks.
@Test
void equalsContractWorks() {
// setup:
final var key = new EntityNumPair(numbers);
// given
var other = new MerkleUniqueToken(owner, metadata, otherTimestamp);
other.setKey(key);
var other2 = new MerkleUniqueToken(owner, otherMetadata, timestamp);
other2.setKey(key);
var other3 = new MerkleUniqueToken(otherOwner, metadata, timestamp);
other3.setKey(key);
var other4 = new MerkleUniqueToken(owner, metadata, timestamp);
other4.setKey(new EntityNumPair(numbers + 1));
var identical = new MerkleUniqueToken(owner, metadata, timestamp);
identical.setKey(key);
// expect
assertNotEquals(subject, new Object());
assertNotEquals(subject, other);
assertNotEquals(subject, other2);
assertNotEquals(subject, other3);
assertNotEquals(subject, other4);
assertEquals(subject, identical);
}
Aggregations