// Path: core/src/main/java/com/github/phantomthief/util/MoreRunnables.java
// public final class MoreRunnables {
// 
//     /**
//      * 将给定的{@link Runnable}包装为只执行一次的对象，通常可以用来做首次运行时初始化的工作
//      *
//      * @param runnable 传入的{@link Runnable}
//      * @return 经过包装，只运行一次的{@link Runnable}
//      */
//     public static Runnable runOnce(Runnable runnable) {
//         return new Runnable() {
// 
//             private final Supplier<Void> supplier = MoreSuppliers.lazy(() -> {
//                 runnable.run();
//                 return null;
//             });
// 
//             @Override
//             public void run() {
//                 supplier.get();
//             }
//         };
//     }
// }


import com.github.phantomthief.util.MoreRunnables;
import static org.junit.jupiter.api.Assertions.fail;
import java.util.concurrent.atomic.AtomicBoolean;
import org.junit.jupiter.api.Test;
package com.github.phantomthief.test;





/**
 * @author w.vela
 * Created on 16/3/14.
 */
class MoreRunnablesTest {

    @Test
    void test() {
        AtomicBoolean runned = new AtomicBoolean(false);
// Path: core/src/main/java/com/github/phantomthief/util/MoreRunnables.java
// public final class MoreRunnables {
// 
//     /**
//      * 将给定的{@link Runnable}包装为只执行一次的对象，通常可以用来做首次运行时初始化的工作
//      *
//      * @param runnable 传入的{@link Runnable}
//      * @return 经过包装，只运行一次的{@link Runnable}
//      */
//     public static Runnable runOnce(Runnable runnable) {
//         return new Runnable() {
// 
//             private final Supplier<Void> supplier = MoreSuppliers.lazy(() -> {
//                 runnable.run();
//                 return null;
//             });
// 
//             @Override
//             public void run() {
//                 supplier.get();
//             }
//         };
//     }
// }


// Path: core/src/test/java/com/github/phantomthief/test/MoreRunnablesTest.java
import com.github.phantomthief.util.MoreRunnables;
import static org.junit.jupiter.api.Assertions.fail;
import java.util.concurrent.atomic.AtomicBoolean;
import org.junit.jupiter.api.Test;

package com.github.phantomthief.test;





/**
 * @author w.vela
 * Created on 16/3/14.
 */
class MoreRunnablesTest {

    @Test
    void test() {
        AtomicBoolean runned = new AtomicBoolean(false);
        Runnable runOnce = MoreRunnables.runOnce(() -> {