@Test
    public void testBasicScheduleRefresh() throws Exception {
        String keyId = "abc123";
        MockTime time = new MockTime();
        HttpsJwks httpsJwks = spyHttpsJwks();

       // we use mocktime here to ensure that scheduled refresh _doesn't_ run and update the invocation count
       // we expect httpsJwks.refresh() to be invoked twice, once from init() and maybeExpediteRefresh() each
        try (RefreshingHttpsJwks refreshingHttpsJwks = getRefreshingHttpsJwks(time, httpsJwks)) {
            refreshingHttpsJwks.init();
            verify(httpsJwks, times(1)).refresh();
            assertTrue(refreshingHttpsJwks.maybeExpediteRefresh(keyId));
            verify(httpsJwks, times(2)).refresh();
        }
    }
Test that a key not previously scheduled for refresh will be scheduled without a refresh.
clients/src/test/java/org/apache/kafka/common/security/oauthbearer/internals/secured/RefreshingHttpsJwksTest.java