### Question:
SoapBookmarkService extends AbstractService implements BookmarkService { @Override public WSBookmark bookmarkFolder(String sid, long folderId) throws Exception { checkFolderAvailable(sid, folderId); User user = validateSession(sid); WSFolder folder = checkFolderAvailable(sid, folderId); BookmarkDAO bDao = (BookmarkDAO) Context.get().getBean(BookmarkDAO.class); Bookmark bmark = bDao.findByUserIdAndDocId(user.getId(), folderId); if (bmark == null) { bmark = new Bookmark(); bmark.setType(Bookmark.TYPE_DOCUMENT); bmark.setTitle(folder.getName()); bmark.setFileType("folder"); bmark.setUserId(user.getId()); bmark.setTargetId(folderId); bDao.store(bmark); } return WSBookmark.fromBookmark(bmark); }  @Override WSBookmark saveBookmark(String sid, WSBookmark bookmark); @Override WSBookmark bookmarkDocument(String sid, long docId); @Override WSBookmark bookmarkFolder(String sid, long folderId); @Override WSBookmark[] getBookmarks(String sid); @Override void deleteBookmark(String sid, long bookmarkId); @Override void unbookmarkDocument(String sid, long docId); @Override void unbookmarkFolder(String sid, long folderId);  }### Answer:
@Test public void testBookmarkFolder() throws Exception { bookmarkService.bookmarkFolder("", 5L); bookmarkService.bookmarkFolder("", 4L); WSBookmark[] bookmarks = bookmarkService.getBookmarks(""); Assert.assertEquals(2, bookmarks.length); try { bookmarkService.bookmarkDocument("", 99L); Assert.fail("the folder doesn't exist, why exception was not raised."); } catch (Throwable t) { } }