@Test public void removeNoteTest() { Note rootNote1 = rootFolder.getNotes().get(0); Note aNote1 = aFolder.getNotes().get(0); Note abNote1 = abFolder.getNotes().get(0); folderView.removeNote(rootNote1); folderView.removeNote(aNote1); folderView.removeNote(abNote1); assertEquals(3, folderView.countFolders()); assertEquals(3, folderView.countNotes()); assertEquals(1, rootFolder.countNotes()); assertEquals(1, aFolder.countNotes()); assertEquals(1, abFolder.countNotes()); }
public void removeNote(Note note) { if (!index.containsKey(note)) { return; } Folder folder = index.get(note); folder.removeNote(note); removeFolderIfEmpty(folder.getId()); synchronized (index) { index.remove(note); } }
FolderView implements NoteNameListener, FolderListener { public void removeNote(Note note) { if (!index.containsKey(note)) { return; } Folder folder = index.get(note); folder.removeNote(note); removeFolderIfEmpty(folder.getId()); synchronized (index) { index.remove(note); } } }
FolderView implements NoteNameListener, FolderListener { public void removeNote(Note note) { if (!index.containsKey(note)) { return; } Folder folder = index.get(note); folder.removeNote(note); removeFolderIfEmpty(folder.getId()); synchronized (index) { index.remove(note); } }  }
FolderView implements NoteNameListener, FolderListener { public void removeNote(Note note) { if (!index.containsKey(note)) { return; } Folder folder = index.get(note); folder.removeNote(note); removeFolderIfEmpty(folder.getId()); synchronized (index) { index.remove(note); } }  Folder getFolder(String folderId); Folder renameFolder(String oldFolderId, String newFolderId); Folder getFolderOf(Note note); void putNote(Note note); void removeNote(Note note); void clear(); boolean hasFolder(String folderId); boolean hasNote(Note note); int countFolders(); int countNotes(); @Override void onNoteNameChanged(Note note, String oldName); @Override void onFolderRenamed(Folder folder, String oldFolderId); }
FolderView implements NoteNameListener, FolderListener { public void removeNote(Note note) { if (!index.containsKey(note)) { return; } Folder folder = index.get(note); folder.removeNote(note); removeFolderIfEmpty(folder.getId()); synchronized (index) { index.remove(note); } }  Folder getFolder(String folderId); Folder renameFolder(String oldFolderId, String newFolderId); Folder getFolderOf(Note note); void putNote(Note note); void removeNote(Note note); void clear(); boolean hasFolder(String folderId); boolean hasNote(Note note); int countFolders(); int countNotes(); @Override void onNoteNameChanged(Note note, String oldName); @Override void onFolderRenamed(Folder folder, String oldFolderId);  }