@Test public void getKeyByAlgorithmAndId_returnsNull_onEmptyJSONWebKeySet() { assertThat(cut.getKeyByAlgorithmAndId(JSON_WEB_KEY.getKeyAlgorithm(), JSON_WEB_KEY.getId())).isNull(); }
@Nullable public JsonWebKey getKeyByAlgorithmAndId(JwtSignatureAlgorithm keyAlgorithm, String keyId) { return getTokenStreamWithTypeAndKeyId(keyAlgorithm, keyId) .findFirst() .orElse(null); }
JsonWebKeySet { @Nullable public JsonWebKey getKeyByAlgorithmAndId(JwtSignatureAlgorithm keyAlgorithm, String keyId) { return getTokenStreamWithTypeAndKeyId(keyAlgorithm, keyId) .findFirst() .orElse(null); } }
JsonWebKeySet { @Nullable public JsonWebKey getKeyByAlgorithmAndId(JwtSignatureAlgorithm keyAlgorithm, String keyId) { return getTokenStreamWithTypeAndKeyId(keyAlgorithm, keyId) .findFirst() .orElse(null); } JsonWebKeySet(); }
JsonWebKeySet { @Nullable public JsonWebKey getKeyByAlgorithmAndId(JwtSignatureAlgorithm keyAlgorithm, String keyId) { return getTokenStreamWithTypeAndKeyId(keyAlgorithm, keyId) .findFirst() .orElse(null); } JsonWebKeySet(); @Nullable JsonWebKey getKeyByAlgorithmAndId(JwtSignatureAlgorithm keyAlgorithm, String keyId); Set<JsonWebKey> getAll(); boolean put(@Nonnull JsonWebKey jsonWebKey); void putAll(JsonWebKeySet jsonWebKeySet); }
JsonWebKeySet { @Nullable public JsonWebKey getKeyByAlgorithmAndId(JwtSignatureAlgorithm keyAlgorithm, String keyId) { return getTokenStreamWithTypeAndKeyId(keyAlgorithm, keyId) .findFirst() .orElse(null); } JsonWebKeySet(); @Nullable JsonWebKey getKeyByAlgorithmAndId(JwtSignatureAlgorithm keyAlgorithm, String keyId); Set<JsonWebKey> getAll(); boolean put(@Nonnull JsonWebKey jsonWebKey); void putAll(JsonWebKeySet jsonWebKeySet);  }