package info.izumin.android.droidux.sample.entity;

import com.google.gson.Gson;

import java.util.List;

/**
 * Created by izumin on 11/4/15.
 */
public class TodoList {
    public static final String TAG = TodoList.class.getSimpleName();

    private List<Todo> todoList;

    public TodoList(List<Todo> todoList) {
        this.todoList = todoList;
    }

    public List<Todo> getTodoList() {
        return todoList;
    }

    @Override
    public String toString() {
        return new Gson().toJson(this);
    }

    public static class Todo {
        private final int id;
        private final boolean completed;
        private final String text;

        public Todo(int id, String text) {
            this.id = id;
            this.text = text;
            this.completed = false;
        }

        public Todo(int id, String text, boolean isCompleted) {
            this.id = id;
            this.text = text;
            this.completed = isCompleted;
        }

        public int getId() {
            return id;
        }

        public boolean isCompleted() {
            return completed;
        }

        public String getText() {
            return text;
        }

        @Override
        public String toString() {
            return new Gson().toJson(this);
        }
    }
}

@@ -99,16 +99,39 @@
 .List;%0A%0A
+import rx.Observable;%0A%0A
 /**%0A * C
@@ -441,24 +441,189 @@
 ist;%0A    %7D%0A%0A
+    public Todo getTodoById(int id) %7B%0A        return Observable.from(getTodoList())%0A                .filter(todo -%3E id == todo.getId()).toBlocking().first();%0A    %7D%0A%0A
     @Overrid

Implement TodoList#getTodoById()