package com.kevin.notes;


import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.arch.lifecycle.ViewModel;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

class NoteListViewModel extends ViewModel {

    private MutableLiveData<List<Note>> notes;

    public LiveData<List<Note>> getNotes() {
        if (notes == null) {
            notes = new MutableLiveData<>();
            loadNotes();
        }
        return notes;
    }

    private void loadNotes() {
        notes.setValue(new ArrayList<>(Arrays.asList(
                new Note("Title 1", "Value 1"),
                new Note("Title 2", "Value 2"),
                new Note("Title 3", "Value 3")
        )));
    }
}

@@ -94,119 +94,52 @@
 cle.
-MutableLiveData;%0Aimport android.arch.lifecycle.ViewModel;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;
+ViewModel;%0A%0Aimport com.kevin.notes.db.Note;%0A
 %0Aimp
@@ -216,23 +216,16 @@
 private 
-Mutable
 LiveData
@@ -260,37 +260,25 @@
 lic 
-LiveData%3CList%3CNote%3E%3E getNotes
+NoteListViewModel
 () %7B
@@ -290,90 +290,57 @@
     
-if (
 notes =
-= null) %7B%0A            notes = new MutableLiveData%3C%3E();%0A            
+ NoteApplication.getDb().noteDao().
 load
+All
 Note
@@ -352,282 +352,76 @@
     
-  
-  %7D%0A        return notes;%0A    %7D%0A%0A    private void loadNotes() %7B%0A        notes.setValue(new ArrayList%3C%3E(Arrays.asList(%0A                new Note(%22Title 1%22, %22Value 1%22),%0A                new Note(%22Title 2%22, %22Value 2%22),%0A                new Note(%22Title 3%22, %22Value 3%22)%0A        )))
+%7D%0A%0A    public LiveData%3CList%3CNote%3E%3E getNotes() %7B%0A        return notes
 ;%0A  

Use Room and LiveData for `NoteListViewModel`