@Test public void indexNoteNameUpdatedOnNoteSave() throws IOException {

  //given: total 2 notebooks, 3 paragraphs
  Note note1 = newNoteWithParagraph("Notebook1", "test");
  Note note2 = newNoteWithParagraphs("Notebook2", "not test", "not test at all");
  notebookIndex.addIndexDocs(Arrays.asList(note1, note2));
  assertThat(resultForQuery("test").size()).isEqualTo(3);
  //when
  note1.setName("NotebookN");
  note1.persist(null);
  //then
  assertThat(resultForQuery("Notebook1")).isEmpty();
  assertThat(resultForQuery("NotebookN")).isNotEmpty();
  assertThat(resultForQuery("NotebookN").size()).isEqualTo(1);
}