### Question:
Federation { public boolean hasPublicKey(UldECKey key) { return getPublicKeyIndex(key) != null; } Federation(List<UldECKey> publicKeys, Instant creationTime, long creationBlockNumber,  NetworkParameters uldParams); List<UldECKey> getPublicKeys(); int getNumberOfSignaturesRequired(); Instant getCreationTime(); NetworkParameters getUldParams(); long getCreationBlockNumber(); Script getRedeemScript(); Script getP2SHScript(); Address getAddress(); int getSize(); Integer getPublicKeyIndex(UldECKey key); boolean hasPublicKey(UldECKey key); boolean hasMemberWithUscAddress(byte[] address); @Override String toString(); @Override boolean equals(Object other); @Override int hashCode();  }### Answer:
@Test public void hasPublicKey() { for (int i = 0; i < federation.getPublicKeys().size(); i++) { Assert.assertTrue(federation.hasPublicKey(sortedPublicKeys.get(i))); } Assert.assertFalse(federation.hasPublicKey(UldECKey.fromPrivate(BigInteger.valueOf(1234)))); }