### Question:
ShardInfo { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ShardInfo other = (ShardInfo) obj; return new EqualsBuilder().append(concurrencyToken, other.concurrencyToken) .append(parentShardIds, other.parentShardIds).append(shardId, other.shardId) .append(streamIdentifierSerOpt.orElse(""), other.streamIdentifierSerOpt.orElse("")).isEquals(); } ShardInfo(@NonNull final String shardId,
            final String concurrencyToken,
            final Collection<String> parentShardIds,
            final ExtendedSequenceNumber checkpoint);  ShardInfo(@NonNull final String shardId,
            final String concurrencyToken,
            final Collection<String> parentShardIds,
            final ExtendedSequenceNumber checkpoint,
            final String streamIdentifierSer); List<String> parentShardIds(); boolean isCompleted(); @Override int hashCode(); @Override boolean equals(Object obj); static String getLeaseKey(ShardInfo shardInfo); static String getLeaseKey(ShardInfo shardInfo, String shardIdOverride);  }### Answer:
@Test public void testPacboyShardInfoEqualsWithSameArgs() { ShardInfo equalShardInfo = new ShardInfo(SHARD_ID, CONCURRENCY_TOKEN, parentShardIds, ExtendedSequenceNumber.LATEST); assertTrue("Equal should return true for arguments all the same", testShardInfo.equals(equalShardInfo)); }
@Test public void testPacboyShardInfoEqualsWithNull() { assertFalse("Equal should return false when object is null", testShardInfo.equals(null)); }
@Test public void testPacboyShardInfoEqualsForfToken() { ShardInfo diffShardInfo = new ShardInfo(SHARD_ID, UUID.randomUUID().toString(), parentShardIds, ExtendedSequenceNumber.LATEST); assertFalse("Equal should return false with different concurrency token", diffShardInfo.equals(testShardInfo)); diffShardInfo = new ShardInfo(SHARD_ID, null, parentShardIds, ExtendedSequenceNumber.LATEST); assertFalse("Equal should return false for null concurrency token", diffShardInfo.equals(testShardInfo)); }
@Test public void testPacboyShardInfoEqualsForDifferentlyOrderedParentIds() { List<String> differentlyOrderedParentShardIds = new ArrayList<>(); differentlyOrderedParentShardIds.add("shard-2"); differentlyOrderedParentShardIds.add("shard-1"); ShardInfo shardInfoWithDifferentlyOrderedParentShardIds = new ShardInfo(SHARD_ID, CONCURRENCY_TOKEN, differentlyOrderedParentShardIds, ExtendedSequenceNumber.LATEST); assertTrue("Equal should return true even with parent shard Ids reordered", shardInfoWithDifferentlyOrderedParentShardIds.equals(testShardInfo)); }
@Test public void testPacboyShardInfoEqualsForParentIds() { Set<String> diffParentIds = new HashSet<>(); diffParentIds.add("shard-3"); diffParentIds.add("shard-4"); ShardInfo diffShardInfo = new ShardInfo(SHARD_ID, CONCURRENCY_TOKEN, diffParentIds, ExtendedSequenceNumber.LATEST); assertFalse("Equal should return false with different parent shard Ids", diffShardInfo.equals(testShardInfo)); diffShardInfo = new ShardInfo(SHARD_ID, CONCURRENCY_TOKEN, null, ExtendedSequenceNumber.LATEST); assertFalse("Equal should return false with null parent shard Ids", diffShardInfo.equals(testShardInfo)); }