### Question:
LoadedPublicKey { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; LoadedPublicKey that = (LoadedPublicKey) o; return Objects.equals(kid, that.kid) && Objects.equals(publicKey, that.publicKey) && Objects.equals(keySource, that.keySource); } LoadedPublicKey(String kid, RSAPublicKey publicKey, KeySource keySource); String getKid(); RSAPublicKey getPublicKey(); KeySource getKeySource(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void shouldBeEqualWithDifferentKeyInstances() { URI pemKeyLocation = new File(ResourceHelpers.resourceFilePath("example.pem")).toURI(); PemKeySource pemKeySource = new PemKeySource(null, pemKeyLocation); List<LoadedPublicKey> loadedPublicKeys1 = pemKeySource.loadKeysFromSource(); List<LoadedPublicKey> loadedPublicKeys2 = pemKeySource.loadKeysFromSource(); assertThat(loadedPublicKeys1).hasSize(1); LoadedPublicKey key1 = loadedPublicKeys1.get(0); LoadedPublicKey key2 = loadedPublicKeys2.get(0); assertThat(key1.equals(key2)).isTrue(); assertThat(key1).isNotSameAs(key2); }