@Test
public void testKeyStoreJwkKeyResolver() throws MalformedURLException {

    KeyStoreJwkKeyResolver resolver = null; BiFunction<Field, KeyStoreJwkKeyResolver, Object> getFieldValue = (f, object) -> {
        try {
            f.setAccessible(true);
            return f.get(object);
        } catch (IllegalArgumentException | IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    };
    resolver = new KeyStoreJwkKeyResolver(null, null, null);
    assertNotNull(resolver);
    for (Field f : resolver.getClass().getDeclaredFields()) {
        switch (f.getName()) {
            case "keyStore":
                assertNull(getFieldValue.apply(f, resolver));
                break;
            case "jwksResolver":
                assertNotNull(getFieldValue.apply(f, resolver));
                break;
        }
    }
    resolver = new KeyStoreJwkKeyResolver(null, "file:///", null);
    assertNotNull(resolver);
    for (Field f : resolver.getClass().getDeclaredFields()) {
        switch (f.getName()) {
            case "keyStore":
                assertNull(getFieldValue.apply(f, resolver));
                break;
            case "jwksResolver":
                assertNotNull(getFieldValue.apply(f, resolver));
                break;
        }
    }
    resolver = new KeyStoreJwkKeyResolver(baseKeyStore, "file:///", null);
    assertNotNull(resolver);
    for (Field f : resolver.getClass().getDeclaredFields()) {
        switch (f.getName()) {
            case "keyStore":
                assertSame(getFieldValue.apply(f, resolver), baseKeyStore);
                break;
            case "jwksResolver":
                assertNotNull(getFieldValue.apply(f, resolver));
                break;
        }
    }
}