public PreviewLayerProvider() { super(); // Initialization of an inner cache in order to avoid to calculate two times // the size() method in a time minor than a second CacheBuilder<Object, Object> builder = CacheBuilder.newBuilder(); cache = builder.expireAfterWrite(DEFAULT_CACHE_TIME, TimeUnit.SECONDS).build(); // Callable which internally calls the size method sizeCaller = new SizeCallable(); // Callable which internally calls the fullSize() method fullSizeCaller = new FullSizeCallable(); }