@@ -0,0 +1,2004 @@
+package com.github.phantomthief.test;%0A%0Aimport static java.util.concurrent.TimeUnit.MILLISECONDS;%0Aimport static java.util.concurrent.TimeUnit.MINUTES;%0Aimport static java.util.concurrent.TimeUnit.SECONDS;%0Aimport static org.junit.jupiter.api.Assertions.assertTrue;%0A%0Aimport java.util.concurrent.atomic.AtomicBoolean;%0Aimport java.util.concurrent.atomic.LongAdder;%0A%0Aimport org.junit.jupiter.api.Test;%0A%0Aimport com.github.phantomthief.util.MoreSuppliers;%0Aimport com.github.phantomthief.util.MoreSuppliers.CloseableSupplier;%0A%0A/**%0A * @author w.vela%0A * Created on 2022-01-30.%0A */%0Aclass MoreSuppliersConcurrentTest %7B%0A%0A    @Test%0A    void test() throws InterruptedException %7B%0A        CloseableSupplier%3CString%3E supplier = MoreSuppliers.lazy(this::init, true);%0A        AtomicBoolean term = new AtomicBoolean();%0A        LongAdder succ = new LongAdder();%0A        LongAdder failed = new LongAdder();%0A        new Thread(() -%3E %7B%0A            while(!term.get()) %7B%0A                try %7B%0A                    supplier.tryClose(it -%3E %7B%0A                        MILLISECONDS.sleep(1);%0A                    %7D);%0A                %7D catch (InterruptedException ignore) %7B%0A                    // ignore%0A                %7D%0A            %7D%0A        %7D).start();%0A        for (int i = 0; i %3C 100; i++) %7B%0A            new Thread(() -%3E %7B%0A                while (!term.get()) %7B%0A                    String s = supplier.get();%0A                    if (s == null) %7B%0A                        failed.increment();%0A                    %7D else %7B%0A                        succ.increment();%0A                    %7D%0A                %7D%0A            %7D).start();%0A        %7D%0A        for (int i = 0; i %3C 30; i++) %7B%0A            System.out.println(%22waiting:%22 + i + %22, current:%22 + succ.sum() + %22, %22 + failed.sum());%0A            SECONDS.sleep(1);%0A            if (failed.sum() %3E 0) %7B%0A                break;%0A            %7D%0A        %7D%0A        term.set(true);%0A        assertTrue(failed.sum() == 0);%0A    %7D%0A%0A    private String init() %7B%0A        return System.currentTimeMillis() + %22%22;%0A    %7D%0A%7D%0A

add concurrent test for closeable supplier.