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

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

/**
 * Created by wizzardo on 16.04.16.
 */
public class FlowMax<A> extends FlowProcessor<A, A> {
    private A max;

    public FlowMax(A def) {
        max = def;
    }

    @Override
    public void process(A a) {
        if (max == null || ((Comparable<A>) max).compareTo(a) < 0)
            max = a;
    }

    @Override
    public A get() {
        return max;
    }
}

@@ -49,67 +49,8 @@
 s;%0A%0A
-import com.wizzardo.tools.collections.flow.FlowProcessor;%0A%0A
 /**%0A
@@ -136,10 +136,13 @@
 cess
-or
+OnEnd
 %3CA, 

fix tests