class Federation {

    @Override
    public boolean equals(Object other) {
        if (this == other) {
            return true;
        }

        if (other == null || this.getClass() != other.getClass()) {
            return false;
        }

        Federation otherFederation = (Federation) other;

        ByteArrayWrapper[] thisPublicKeys = this.getPublicKeys().stream()
                .sorted(UldECKey.PUBKEY_COMPARATOR)
                .map(k -> new ByteArrayWrapper(k.getPubKey()))
                .toArray(ByteArrayWrapper[]::new);
        ByteArrayWrapper[] otherPublicKeys = otherFederation.getPublicKeys().stream()
                .sorted(UldECKey.PUBKEY_COMPARATOR)
                .map(k -> new ByteArrayWrapper(k.getPubKey()))
                .toArray(ByteArrayWrapper[]::new);

        return this.getNumberOfSignaturesRequired() == otherFederation.getNumberOfSignaturesRequired() &&
                this.getSize() == otherFederation.getSize() &&
                this.getCreationTime().equals(otherFederation.getCreationTime()) &&
                this.creationBlockNumber == otherFederation.creationBlockNumber &&
                this.uldParams.equals(otherFederation.uldParams) &&
                Arrays.equals(thisPublicKeys, otherPublicKeys);
    }

    public  Federation(List<UldECKey> publicKeys, Instant creationTime, long creationBlockNumber,  NetworkParameters uldParams);

}