Note implements Serializable, JobListener { private void setLastReplName(Paragraph lastParagraphStarted) { if (StringUtils.isNotEmpty(lastParagraphStarted.getRequiredReplName())) { lastReplName.set(lastParagraphStarted.getRequiredReplName()); } } Note();  Note(NotebookRepo repo, NoteInterpreterLoader replLoader,
      JobListenerFactory jlFactory, SearchService noteIndex, Credentials credentials); String id(); String getId(); String getName(); void setName(String name); NoteInterpreterLoader getNoteReplLoader(); void setReplLoader(NoteInterpreterLoader replLoader); JobListenerFactory getJobListenerFactory(); void setJobListenerFactory(JobListenerFactory jobListenerFactory); NotebookRepo getNotebookRepo(); void setNotebookRepo(NotebookRepo repo); void setIndex(SearchService index); Credentials getCredentials(); void setCredentials(Credentials credentials); @SuppressWarnings("rawtypes") Map<String, List<AngularObject>> getAngularObjects(); Paragraph addParagraph(); void addCloneParagraph(Paragraph srcParagraph); Paragraph insertParagraph(int index); Paragraph removeParagraph(String paragraphId); Paragraph clearParagraphOutput(String paragraphId); void moveParagraph(String paragraphId, int index); void moveParagraph(String paragraphId, int index, boolean throwWhenIndexIsOutOfBound); boolean isLastParagraph(String paragraphId); Paragraph getParagraph(String paragraphId); Paragraph getLastParagraph(); List<Map<String, String>> generateParagraphsInfo(); void runAll(); void run(String paragraphId); boolean isTerminated(); List<InterpreterCompletion> completion(String paragraphId, String buffer, int cursor); List<Paragraph> getParagraphs(); void persist(AuthenticationInfo subject); void setLastReplName(String paragraphId); void persist(int maxDelaySec, AuthenticationInfo subject); void unpersist(AuthenticationInfo subject); Map<String, Object> getConfig(); void setConfig(Map<String, Object> config); Map<String, Object> getInfo(); void setInfo(Map<String, Object> info); String getLastReplName(); String getLastInterpreterName(); @Override void beforeStatusChange(Job job, Status before, Status after); @Override void afterStatusChange(Job job, Status before, Status after); @Override void onProgressUpdate(Job job, int progress);  }
@Test public void setLastReplName() { String paragraphId = "HelloWorld"; Note note = Mockito.spy(new Note(repo, replLoader, jobListenerFactory, index, credentials)); Paragraph mockParagraph = Mockito.mock(Paragraph.class); when(note.getParagraph(paragraphId)).thenReturn(mockParagraph); when(mockParagraph.getRequiredReplName()).thenReturn("spark"); note.setLastReplName(paragraphId); assertEquals("spark", note.getLastReplName()); }