// Path: src/main/java/io/advantageous/reakt/Callback.java
// public interface Callback<T> {
// 
//     /**
//      * (Service view)
//      * This allows services to send back a failed result easily to the client/handler.
//      * <p>
//      * This is a helper methods for producers (services that produce results) to send a failed result.
//      *
//      * @param error error
//      */
//     void reject(final Throwable error);
// 
// 
//     /**
//      * (Service view)
//      * This allows services to send back a failed result easily to the client/handler.
//      * <p>
//      * This is a helper methods for producers (services that produce results) to send a failed result.
//      *
//      * @param errorMessage error message
//      */
//     void reject(final String errorMessage);
// 
// 
//     /**
//      * (Service view)
//      * This allows services to send back a failed result easily to the client/handler.
//      * <p>
//      * This is a helper methods for producers (services that produce results) to send a failed result.
//      *
//      * @param errorMessage error message
//      * @param error        exception
//      */
//     void reject(final String errorMessage, final Throwable error);
// 
// 
//     /**
//      * Calls replayDone, for VOID callback only. ES6 promise style.
//      */
//     void resolve();
// 
//     /**
//      * Resolve resolves a promise.
//      *
//      * @param result makes it more compatible with ES6 style promises
//      */
//     void resolve(final T result);
// 
// 
// }


import io.advantageous.reakt.Callback;
import io.advantageous.reakt.promise.impl.*;
import java.time.Duration;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;
    static <K, V> Promise<Map<K, V>> blockingPromiseMap(final Class<K> keyType,
                                                        final Class<V> valueType) {
        return new BlockingPromise<>();
    }

    /**
     * Generic set promise.
     * Added to make static imports possible.
     * Create a blocking promise.
     * NOTE BLOCKING PROMISES ARE FOR LEGACY INTEGRATION AND TESTING ONLY!!!
     *
     * @param componentType component type of set
     * @param <T>           promise a set of type T
     * @return new PromiseHandler for a set of type T
     */
    @SuppressWarnings("unused")
    static <T> Promise<Set<T>> blockingPromiseSet(Class<T> componentType) {
        return new BlockingPromise<>();
    }


    /**
     * Create an invokable promise.
     * After you create a promise you register its then(...) and catchError(...) and then you use it to
     * handle a callback.
     *
     * @param <T>              type of result
     * @param callbackConsumer promise consumer so you can call reject or resolve on the service side
     * @return new promise
     */
// Path: src/main/java/io/advantageous/reakt/Callback.java
// public interface Callback<T> {
// 
//     /**
//      * (Service view)
//      * This allows services to send back a failed result easily to the client/handler.
//      * <p>
//      * This is a helper methods for producers (services that produce results) to send a failed result.
//      *
//      * @param error error
//      */
//     void reject(final Throwable error);
// 
// 
//     /**
//      * (Service view)
//      * This allows services to send back a failed result easily to the client/handler.
//      * <p>
//      * This is a helper methods for producers (services that produce results) to send a failed result.
//      *
//      * @param errorMessage error message
//      */
//     void reject(final String errorMessage);
// 
// 
//     /**
//      * (Service view)
//      * This allows services to send back a failed result easily to the client/handler.
//      * <p>
//      * This is a helper methods for producers (services that produce results) to send a failed result.
//      *
//      * @param errorMessage error message
//      * @param error        exception
//      */
//     void reject(final String errorMessage, final Throwable error);
// 
// 
//     /**
//      * Calls replayDone, for VOID callback only. ES6 promise style.
//      */
//     void resolve();
// 
//     /**
//      * Resolve resolves a promise.
//      *
//      * @param result makes it more compatible with ES6 style promises
//      */
//     void resolve(final T result);
// 
// 
// }


// Path: src/main/java/io/advantageous/reakt/promise/Promises.java
import io.advantageous.reakt.Callback;
import io.advantageous.reakt.promise.impl.*;
import java.time.Duration;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;

    static <K, V> Promise<Map<K, V>> blockingPromiseMap(final Class<K> keyType,
                                                        final Class<V> valueType) {
        return new BlockingPromise<>();
    }

    /**
     * Generic set promise.
     * Added to make static imports possible.
     * Create a blocking promise.
     * NOTE BLOCKING PROMISES ARE FOR LEGACY INTEGRATION AND TESTING ONLY!!!
     *
     * @param componentType component type of set
     * @param <T>           promise a set of type T
     * @return new PromiseHandler for a set of type T
     */
    @SuppressWarnings("unused")
    static <T> Promise<Set<T>> blockingPromiseSet(Class<T> componentType) {
        return new BlockingPromise<>();
    }


    /**
     * Create an invokable promise.
     * After you create a promise you register its then(...) and catchError(...) and then you use it to
     * handle a callback.
     *
     * @param <T>              type of result
     * @param callbackConsumer promise consumer so you can call reject or resolve on the service side
     * @return new promise
     */
    static <T> Promise<T> invokablePromise(Consumer<Callback<T>> callbackConsumer) {