public void testLazy() {
AtomicInteger ai = new AtomicInteger(0);
Lazy<String> lazyString = lazy(() -> "Value: " + ai.incrementAndGet());
assertEquals(0, ai.get());
assertEquals("Value: 1", lazyString.get());
assertEquals(2, ai.incrementAndGet());
assertEquals("Value: 1", lazyString.get());
}
@Test
public void testThreadedLazy() throws InterruptedException, ExecutionException {