// Path: example/src/main/java/com/yheriatovych/reductor/example/Utils.java
// public interface Utils {
//     interface Predicate<T> {
//         boolean call(T value);
//     }
// 
//     static <T> PStack<T> filter(PStack<T> xs, Predicate<T> predicate) {
//         if (xs.isEmpty()) return xs;
//         else {
//             T head = xs.get(0);
//             PStack<T> tail = xs.subList(1);
//             if (predicate.call(head)) {
//                 return filter(tail, predicate).plus(head);
//             } else {
//                 return filter(tail, predicate);
//             }
//         }
//     }
// 
// }


import com.google.auto.value.AutoValue;
import com.google.gson.Gson;
import com.google.gson.TypeAdapter;
import com.yheriatovych.reductor.annotations.CombinedState;
import com.yheriatovych.reductor.example.Utils;
import org.pcollections.ConsPStack;
import java.util.List;
package com.yheriatovych.reductor.example.model;



@CombinedState
@AutoValue
public abstract class AppState {
    public abstract List<Note> notes();

    public abstract NotesFilter filter();

    public static TypeAdapter<AppState> typeAdapter(Gson gson) {
        return new AutoValue_AppState.GsonTypeAdapter(gson);
    }

    public List<Note> getFilteredNotes() {
        List<Note> notes = this.notes();
        NotesFilter filter = this.filter();
// Path: example/src/main/java/com/yheriatovych/reductor/example/Utils.java
// public interface Utils {
//     interface Predicate<T> {
//         boolean call(T value);
//     }
// 
//     static <T> PStack<T> filter(PStack<T> xs, Predicate<T> predicate) {
//         if (xs.isEmpty()) return xs;
//         else {
//             T head = xs.get(0);
//             PStack<T> tail = xs.subList(1);
//             if (predicate.call(head)) {
//                 return filter(tail, predicate).plus(head);
//             } else {
//                 return filter(tail, predicate);
//             }
//         }
//     }
// 
// }


// Path: example/src/main/java/com/yheriatovych/reductor/example/model/AppState.java
import com.google.auto.value.AutoValue;
import com.google.gson.Gson;
import com.google.gson.TypeAdapter;
import com.yheriatovych.reductor.annotations.CombinedState;
import com.yheriatovych.reductor.example.Utils;
import org.pcollections.ConsPStack;
import java.util.List;

package com.yheriatovych.reductor.example.model;



@CombinedState
@AutoValue
public abstract class AppState {
    public abstract List<Note> notes();

    public abstract NotesFilter filter();

    public static TypeAdapter<AppState> typeAdapter(Gson gson) {
        return new AutoValue_AppState.GsonTypeAdapter(gson);
    }

    public List<Note> getFilteredNotes() {
        List<Note> notes = this.notes();
        NotesFilter filter = this.filter();
        return Utils.filter(ConsPStack.from(notes), note ->