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

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

import java.util.Collection;

/**
 * Created by wizzardo on 16.04.16.
 */
public class FlowCollect<A, C extends Collection<A>> extends FlowProcessor<A, C> {
    private final C collection;

    public FlowCollect(C collection) {
        this.collection = collection;
    }

    @Override
    public void process(A a) {
        collection.add(a);
    }

    @Override
    public C get() {
        return collection;
    }
}

@@ -49,67 +49,8 @@
 s;%0A%0A
-import com.wizzardo.tools.collections.flow.FlowProcessor;%0A%0A
 impo
@@ -195,18 +195,21 @@
 cess
-or
+OnEnd
 %3CA, C%3E %7B
 %0A   
@@ -208,40 +208,8 @@
 C%3E %7B
-%0A    private final C collection;
 %0A%0A  
@@ -257,23 +257,14 @@
     
-this.collection
+result
  = c
@@ -338,94 +338,21 @@
     
-collection.add(a);%0A    %7D%0A%0A    @Override%0A    public C get() %7B%0A        return collection
+result.add(a)
 ;%0A  

update 'collect'