### Question:
SupplierCache implements Cache<Object, V> { @SuppressWarnings("unchecked") public static <V> SupplierCache<V> expiring(String name, Supplier<V> supplier, long duration, TimeUnit timeUnit) { return new SupplierCache(name,supplier,duration,timeUnit); } private  SupplierCache(final String name, Supplier<V> supplier,
            long duration, TimeUnit timeUnit); @SuppressWarnings("unchecked") static SupplierCache<V> nonCaching(String name, Supplier<V> supplier); @SuppressWarnings("unchecked") static SupplierCache<V> permanent(String name, Supplier<V> supplier); @SuppressWarnings("unchecked") static SupplierCache<V> expiring(String name, Supplier<V> supplier,
            long duration, TimeUnit timeUnit); Supplier<V> getBaseSupplier(); V get(); V reload(); @Override void put(Object key, V value); @Override V get(Object key); V get(Object key, Callable<? extends V> valueLoader); @Override void remove(Object key); @Override void clear(); @Override String getCacheName(); @Override void putAll(Map<Object, V> map); @Override int getSize();  }### Answer:
@Test public void testExpiring() throws Exception { System.out.println("SupplierCache.nonCaching"); RecordingSupplier supplier = new RecordingSupplier(); SupplierCache<String> cache = SupplierCache.expiring("Blah",supplier,1,TimeUnit.SECONDS); assertEquals(0, supplier.count); assertNotNull(cache.get()); assertEquals(1, supplier.count); assertNotNull(cache.get()); assertEquals(1, supplier.count); Thread.sleep(500); assertNotNull(cache.get()); assertEquals(1, supplier.count); Thread.sleep(1000); assertNotNull(cache.get()); assertEquals(2, supplier.count); }