package com.wizzardo.tools.collections.flow.flows;

import com.wizzardo.tools.collections.flow.Flow;

/**
 * Created by wizzardo on 16.04.16.
 */
public class FlowLimit<T> extends Flow<T, T> {
    private final int number;
    private int counter = 0;

    public FlowLimit(int number) {
        this.number = number;
    }

    @Override
    public void process(T t) {
        if (counter < number) {
            counter++;
            child.process(t);
        }
    }
}

@@ -448,16 +448,53 @@
 ess(t);%0A
+        %7D else %7B%0A            stop();%0A
         

fix test