使用 Caffeine.scheduler让removalListener 生效
private Cache<String, String> cache = Caffeine.newBuilder()
.maximumSize(10_000)
.scheduler(Scheduler.forScheduledExecutorService(Executors.newScheduledThreadPool(1)))
.expireAfterWrite(1, TimeUnit.MINUTES)
.removalListener((String key, String value, RemovalCause cause) ->
System.out.printf("Key %s was removed (%s)%n", key, cause))
.build();