Lazy { public final T get() { createOnce.ensure(); return value; }  final T get(); final void reset();  }
@Test public void testGet() throws InterruptedException { CountDownLatch latch = new CountDownLatch(1); List<Thread> threads = new ArrayList<Thread>(); for (int i = 0; i < 200; ++ i) { threads.add(new Worker(latch)); } for (Thread t : threads) { t.start(); } latch.countDown(); for (Thread t : threads) { t.join(); } Assert.assertEquals(1, Foo.getInstanceCount()); }