class IgniteCollectors {
    /**
     * Empty constructor.
     */
    private IgniteCollectors() { }

    /**
     * Collector of {@link IgniteInternalFuture} inheritors stream to {@link GridCompoundFuture}.
     *
     * @param <T> Result type of inheritor {@link IgniteInternalFuture}.
     * @param <R> Result type of {@link GridCompoundFuture}.
     * @return Compound future that contains all stream futures
     *         and initialized with {@link GridCompoundFuture#markInitialized()}.
     */
    public static <T, R> Collector<? super IgniteInternalFuture,
        ? super GridCompoundFuture<T, R>, GridCompoundFuture<T, R>> toCompoundFuture() {<FILL_FUNCTION_BODY>}
}

        final GridCompoundFuture<T, R> res = new GridCompoundFuture<>();

        return Collectors.collectingAndThen(
            Collectors.reducing(
                res,
                res::add,
                (a, b) -> a // No needs to merge compound futures.
            ),
            GridCompoundFuture::markInitialized
        );
    
<no_super_class>