### Question:
PendingFederation { public Keccak256 getHash() { byte[] encoded = BridgeSerializationUtils.serializePendingFederation(this); return new Keccak256(HashUtil.keccak256(encoded)); } PendingFederation(List<UldECKey> publicKeys); List<UldECKey> getPublicKeys(); boolean isComplete(); PendingFederation addPublicKey(UldECKey key); Federation buildFederation(Instant creationTime, long blockNumber, NetworkParameters uldParams); @Override String toString(); @Override boolean equals(Object other); Keccak256 getHash(); @Override int hashCode();  }### Answer:
@PrepareForTest({ BridgeSerializationUtils.class }) @Test public void getHash() { PowerMockito.mockStatic(BridgeSerializationUtils.class); PowerMockito.when(BridgeSerializationUtils.serializePendingFederation(pendingFederation)).thenReturn(new byte[] { (byte) 0xaa }); Keccak256 expectedHash = new Keccak256(HashUtil.keccak256(new byte[] { (byte) 0xaa })); Assert.assertEquals(expectedHash, pendingFederation.getHash()); }