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

  Note note = notebook.createNote(null);
  note.getNoteReplLoader().setInterpreters(factory.getDefaultInterpreterSettingList());
  ArrayList<Paragraph> paragraphs = new ArrayList<>();
  for (int i = 0; i < 100; i++) {
    Paragraph tmp = note.addParagraph();
    tmp.setText("p" + tmp.getId());
    paragraphs.add(tmp);
  }
  for (Paragraph p : paragraphs) {
    assertEquals(Job.Status.READY, p.getStatus());
  }
  note.runAll();
  while (paragraphs.get(0).getStatus() != Status.FINISHED) Thread.yield();
  factory.restart(note.getNoteReplLoader().getInterpreterSettings().get(0).id());
  boolean isAborted = false;
  for (Paragraph p : paragraphs) {
    logger.debug(p.getStatus().name());
    if (isAborted) {
      assertEquals(Job.Status.ABORT, p.getStatus());
    }
    if (p.getStatus() == Status.ABORT) {
      isAborted = true;
    }
  }
  assertTrue(isAborted);
}