// Path: compiller/src/main/java/com/yheriatovych/reductor/processor/ReductorAnnotationProcessor.java
// @AutoService(Processor.class)
// public class ReductorAnnotationProcessor extends BasicAnnotationProcessor {
//     @Override
//     protected Iterable<? extends ProcessingStep> initSteps() {
//         Env env = new Env(processingEnv.getTypeUtils(),
//                 processingEnv.getElementUtils(),
//                 processingEnv.getMessager(),
//                 processingEnv.getFiler());
// 
//         Map<String, ActionCreatorElement> knownActionCreators = new HashMap<>();
// 
//         return Arrays.asList(
//                 new CombinedStateProcessingStep(env),
//                 new ActionCreatorProcessingStep(env, knownActionCreators),
//                 new AutoReducerProcessingStep(env, knownActionCreators)
//         );
//     }
// 
//     @Override
//     public SourceVersion getSupportedSourceVersion() {
//         return SourceVersion.latestSupported();
//     }
// }


import com.google.auto.value.processor.AutoValueProcessor;
import com.google.testing.compile.JavaFileObjects;
import com.yheriatovych.reductor.processor.ReductorAnnotationProcessor;
import org.junit.Test;
import javax.tools.JavaFileObject;
import static com.google.common.truth.Truth.assertAbout;
import static com.google.testing.compile.JavaSourceSubjectFactory.javaSource;
                "  public Foobar reduce(Foobar state, Action action) {\n" +
                "\n" +
                "    if (state != null) {\n" +
                "    }\n" +
                "\n" +
                "\n" +
                "    //If all values are the same there is no need to create an object\n" +
                "    if (state != null) {\n" +
                "      return state;\n" +
                "    } else {\n" +
                "      return new FoobarImpl();\n" +
                "    }\n" +
                "  }\n" +
                "\n" +
                "  public static Builder builder() {\n" +
                "    return new Builder();\n" +
                "  }\n" +
                "\n" +
                "  public static class Builder {\n" +
                "    private Builder() {\n" +
                "    }\n" +
                "\n" +
                "    public FoobarReducer build() {\n" +
                "      return new FoobarReducer();\n" +
                "    }\n" +
                "  }\n" +
                "}");

        assertAbout(javaSource()).that(source)
                .withCompilerOptions("-Xlint:-processing")
// Path: compiller/src/main/java/com/yheriatovych/reductor/processor/ReductorAnnotationProcessor.java
// @AutoService(Processor.class)
// public class ReductorAnnotationProcessor extends BasicAnnotationProcessor {
//     @Override
//     protected Iterable<? extends ProcessingStep> initSteps() {
//         Env env = new Env(processingEnv.getTypeUtils(),
//                 processingEnv.getElementUtils(),
//                 processingEnv.getMessager(),
//                 processingEnv.getFiler());
// 
//         Map<String, ActionCreatorElement> knownActionCreators = new HashMap<>();
// 
//         return Arrays.asList(
//                 new CombinedStateProcessingStep(env),
//                 new ActionCreatorProcessingStep(env, knownActionCreators),
//                 new AutoReducerProcessingStep(env, knownActionCreators)
//         );
//     }
// 
//     @Override
//     public SourceVersion getSupportedSourceVersion() {
//         return SourceVersion.latestSupported();
//     }
// }


// Path: compiller/src/test/java/com/yheriatovych/reductor/processor/CombinedStateReducerTest.java
import com.google.auto.value.processor.AutoValueProcessor;
import com.google.testing.compile.JavaFileObjects;
import com.yheriatovych.reductor.processor.ReductorAnnotationProcessor;
import org.junit.Test;
import javax.tools.JavaFileObject;
import static com.google.common.truth.Truth.assertAbout;
import static com.google.testing.compile.JavaSourceSubjectFactory.javaSource;

                "  public Foobar reduce(Foobar state, Action action) {\n" +
                "\n" +
                "    if (state != null) {\n" +
                "    }\n" +
                "\n" +
                "\n" +
                "    //If all values are the same there is no need to create an object\n" +
                "    if (state != null) {\n" +
                "      return state;\n" +
                "    } else {\n" +
                "      return new FoobarImpl();\n" +
                "    }\n" +
                "  }\n" +
                "\n" +
                "  public static Builder builder() {\n" +
                "    return new Builder();\n" +
                "  }\n" +
                "\n" +
                "  public static class Builder {\n" +
                "    private Builder() {\n" +
                "    }\n" +
                "\n" +
                "    public FoobarReducer build() {\n" +
                "      return new FoobarReducer();\n" +
                "    }\n" +
                "  }\n" +
                "}");

        assertAbout(javaSource()).that(source)
                .withCompilerOptions("-Xlint:-processing")
                .processedWith(new ReductorAnnotationProcessor())