@Test
public void testSaveNotebook() throws IOException, InterruptedException {

  Note note = notebook.createNote(null);
  note.getNoteReplLoader().setInterpreters(factory.getDefaultInterpreterSettingList());
  Paragraph p1 = note.addParagraph();
  Map<String, Object> config = p1.getConfig();
  config.put("enabled", true);
  p1.setConfig(config);
  p1.setText("%mock1 hello world");
  note.run(p1.getId());
  int timeout = 1;
  while (!p1.isTerminated()) {
    Thread.sleep(1000);
    if (timeout++ > 10) {
      break;
    }
  }
  int i = 0;
  int TEST_COUNT = 10;
  while (i++ < TEST_COUNT) {
    p1.setText("%mock1 hello zeppelin");
    new Thread(new NotebookWriter(note)).start();
    p1.setText("%mock1 hello world");
    new Thread(new NotebookWriter(note)).start();
  }
  note.setName("SaveTest");
  notebookRepo.save(note, null);
  assertEquals(note.getName(), "SaveTest");
}