### Question:
JsonWebKey extends JsonMapObject { public List<String> getX509Chain() { return CastUtils.cast((List<?>)getProperty(X509_CHAIN)); } JsonWebKey();  JsonWebKey(Map<String, Object> values); void setKeyType(KeyType keyType); KeyType getKeyType(); void setPublicKeyUse(PublicKeyUse use); PublicKeyUse getPublicKeyUse(); void setKeyOperation(List<KeyOperation> keyOperation); List<KeyOperation> getKeyOperation(); void setAlgorithm(String algorithm); String getAlgorithm(); void setKeyId(String kid); String getKeyId(); void setX509Url(String x509Url); String getX509Url(); void setX509Chain(List<String> x509Chain); List<String> getX509Chain(); void setX509Thumbprint(String x509Thumbprint); String getX509Thumbprint(); void setX509ThumbprintSHA256(String x509Thumbprint); String getX509ThumbprintSHA256(); JsonWebKey setKeyProperty(String name, Object value); Object getKeyProperty(String name); static final String KEY_TYPE; static final String PUBLIC_KEY_USE; static final String KEY_OPERATIONS; static final String KEY_ALGO; static final String KEY_ID; static final String X509_URL; static final String X509_CHAIN; static final String X509_THUMBPRINT; static final String X509_THUMBPRINT_SHA256; static final String KEY_TYPE_RSA; static final String RSA_MODULUS; static final String RSA_PUBLIC_EXP; static final String RSA_PRIVATE_EXP; static final String RSA_FIRST_PRIME_FACTOR; static final String RSA_SECOND_PRIME_FACTOR; static final String RSA_FIRST_PRIME_CRT; static final String RSA_SECOND_PRIME_CRT; static final String RSA_FIRST_CRT_COEFFICIENT; static final String KEY_TYPE_OCTET; static final String OCTET_KEY_VALUE; static final String KEY_TYPE_ELLIPTIC; static final String EC_CURVE; static final String EC_CURVE_P256; static final String EC_CURVE_P384; static final String EC_CURVE_P521; static final String EC_X_COORDINATE; static final String EC_Y_COORDINATE; static final String EC_PRIVATE_KEY; static final String PUBLIC_KEY_USE_SIGN; static final String PUBLIC_KEY_USE_ENCRYPT; static final String KEY_OPER_SIGN; static final String KEY_OPER_VERIFY; static final String KEY_OPER_ENCRYPT; static final String KEY_OPER_DECRYPT; static final String KEY_OPER_WRAP_KEY; static final String KEY_OPER_UNWRAP_KEY; static final String KEY_OPER_DERIVE_KEY; static final String KEY_OPER_DERIVE_BITS; }### Answer:
@Test public void testPublicSetAsList() throws Exception { JsonWebKeys jwks = readKeySet("jwkPublicSet.txt"); List<JsonWebKey> keys = jwks.getKeys(); assertEquals(3, keys.size()); JsonWebKey ecKey = keys.get(0); assertEquals(6, ecKey.asMap().size()); validatePublicEcKey(ecKey); JsonWebKey rsaKey = keys.get(1); assertEquals(5, rsaKey.asMap().size()); validatePublicRsaKey(rsaKey); JsonWebKey rsaKeyCert = keys.get(2); assertEquals(3, rsaKeyCert.asMap().size()); assertEquals(3, rsaKeyCert.getX509Chain().size()); List<X509Certificate> certs = JwkUtils.toX509CertificateChain(rsaKeyCert); assertEquals(3, certs.size()); }