class PendingFederation {

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

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

        PendingFederation otherFederation = (PendingFederation) 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.getPublicKeys().size() == otherFederation.getPublicKeys().size() &&
                Arrays.equals(thisPublicKeys, otherPublicKeys);
    }

    public  PendingFederation(List<UldECKey> publicKeys);

}