### Question:
BridgeSerializationUtils { public static byte[] serializePendingFederation(PendingFederation pendingFederation) { return serializeUldPublicKeys(pendingFederation.getPublicKeys()); } private  BridgeSerializationUtils(); static byte[] serializeMap(SortedMap<Keccak256, UldTransaction> map); static SortedMap<Keccak256, UldTransaction> deserializeMap(byte[] data, NetworkParameters networkParameters, boolean noInputsTxs); static byte[] serializeUTXOList(List<UTXO> list); static List<UTXO> deserializeUTXOList(byte[] data); static byte[] serializeSet(SortedSet<Sha256Hash> set); static SortedSet<Sha256Hash> deserializeSet(byte[] data); static byte[] serializeMapOfHashesToLong(Map<Sha256Hash, Long> map); static Map<Sha256Hash, Long> deserializeMapOfHashesToLong(byte[] data); static byte[] serializeFederation(Federation federation); static Federation deserializeFederation(byte[] data, Context uldContext); static byte[] serializePendingFederation(PendingFederation pendingFederation); static PendingFederation deserializePendingFederation(byte[] data); static byte[] serializeElection(ABICallElection election); static ABICallElection deserializeElection(byte[] data, AddressBasedAuthorizer authorizer); static byte[] serializeOneOffLockWhitelist(Pair<List<OneOffWhiteListEntry>, Integer> data); static byte[] serializeUnlimitedLockWhitelist(List<UnlimitedWhiteListEntry> entries); static Pair<HashMap<Address, OneOffWhiteListEntry>, Integer> deserializeOneOffLockWhitelistAndDisableBlockHeight(byte[] data, NetworkParameters parameters); static Map<Address, UnlimitedWhiteListEntry> deserializeUnlimitedLockWhitelistEntries(byte[] data, NetworkParameters parameters); static byte[] serializeCoin(Coin coin); @Nullable static Coin deserializeCoin(byte[] data); static byte[] serializeReleaseRequestQueue(ReleaseRequestQueue queue); static ReleaseRequestQueue deserializeReleaseRequestQueue(byte[] data, NetworkParameters networkParameters); static byte[] serializeReleaseTransactionSet(ReleaseTransactionSet set); static ReleaseTransactionSet deserializeReleaseTransactionSet(byte[] data, NetworkParameters networkParameters);  }### Answer:
@Test public void serializePendingFederation() throws Exception { PowerMockito.mockStatic(RLP.class); mock_RLP_encodeList(); mock_RLP_encodeElement(); byte[][] publicKeyBytes = new byte[][]{ UldECKey.fromPrivate(BigInteger.valueOf(100)).getPubKey(), UldECKey.fromPrivate(BigInteger.valueOf(200)).getPubKey(), UldECKey.fromPrivate(BigInteger.valueOf(300)).getPubKey(), UldECKey.fromPrivate(BigInteger.valueOf(400)).getPubKey(), UldECKey.fromPrivate(BigInteger.valueOf(500)).getPubKey(), UldECKey.fromPrivate(BigInteger.valueOf(600)).getPubKey(), }; PendingFederation pendingFederation = new PendingFederation( Arrays.asList(new UldECKey[]{ UldECKey.fromPublicOnly(publicKeyBytes[0]), UldECKey.fromPublicOnly(publicKeyBytes[1]), UldECKey.fromPublicOnly(publicKeyBytes[2]), UldECKey.fromPublicOnly(publicKeyBytes[3]), UldECKey.fromPublicOnly(publicKeyBytes[4]), UldECKey.fromPublicOnly(publicKeyBytes[5]), }) ); byte[] result = BridgeSerializationUtils.serializePendingFederation(pendingFederation); StringBuilder expectedBuilder = new StringBuilder(); pendingFederation.getPublicKeys().stream().sorted(UldECKey.PUBKEY_COMPARATOR).forEach(key -> { expectedBuilder.append("dd"); expectedBuilder.append(Hex.toHexString(key.getPubKey())); }); byte[] expected = Hex.decode(expectedBuilder.toString()); Assert.assertTrue(Arrays.equals(expected, result)); }