### Question:
Federation { public Integer getPublicKeyIndex(UldECKey key) { for (int i = 0; i < publicKeys.size(); i++) { if (Arrays.equals(key.getPubKey(), publicKeys.get(i).getPubKey())) { return i; } } return 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 getPublicKeyIndex() { for (int i = 0; i < federation.getPublicKeys().size(); i++) { Assert.assertEquals(i, federation.getPublicKeyIndex(sortedPublicKeys.get(i)).intValue()); } Assert.assertNull(federation.getPublicKeyIndex(UldECKey.fromPrivate(BigInteger.valueOf(1234)))); }