Lazy implements Supplier<T> { public boolean isInitialized() { return initialized; } Lazy(Supplier<T> supplier);  Lazy(Runnable runnable); @Override synchronized T get(); boolean isInitialized();  }
@Test void isInitialized() { Lazy<Object> lazy = new Lazy<>(Object::new); Assertions.assertFalse(lazy.isInitialized()); Object a = lazy.get(); Object b = lazy.get(); Assertions.assertSame(a, b); Assertions.assertTrue(lazy.isInitialized()); }