### Question:
Jwks { @Override public String toString() { final StringBuilder sb = new StringBuilder("Jwks{"); sb.append("keys=["); sb.append(String.join(", ", keys.keySet())); sb.append("]}"); return sb.toString(); } Jwks(String jwksJson); Map<String, Jwk> getKeys(); Optional<Jwk> getKey(String kid); Set<String> getKeyIds(); @Override String toString();  }### Answer:
@Test public void testAzureAdJwks() throws IOException, InvalidPublicKeyException { final String jwksJson = IOUtils.toString(JwksTest.class.getResourceAsStream("/jwks/azure-ad.json"), StandardCharsets.UTF_8); final Jwks jwks = new Jwks(jwksJson); verifyJwks(jwks, 3); verifyKey(jwks, "piVlloQDSMKxh1m2ygqGSVdgFpA"); verifyKey(jwks, "HlC0R12skxNZ1WQwmjOF_6t_tDE"); verifyKey(jwks, "M6pX7RHoraLsprfJeRCjSxuURhc"); }
@Test public void testSwisspass() throws IOException, InvalidPublicKeyException { final String jwksJson = IOUtils.toString(JwksTest.class.getResourceAsStream("/jwks/swisspass.json"), StandardCharsets.UTF_8); final Jwks jwks = new Jwks(jwksJson); verifyJwks(jwks, 1); verifyKey(jwks, "5dfad4b9"); }
@Test public void testRhSsoJwks() throws IOException, InvalidPublicKeyException { final String jwksJson = IOUtils.toString(JwksTest.class.getResourceAsStream("/jwks/rh-sso.json"), StandardCharsets.UTF_8); final Jwks jwks = new Jwks(jwksJson); verifyJwks(jwks, 3); verifyKey(jwks, "LDZ5q5LudDlCq0ZVof14Gm--AW4mvMMxUsvCMhcM62w"); }