### Question:
FolderServiceImpl extends RemoteServiceServlet implements FolderService { @Override public void rename(long folderId, String name) throws ServerException { Session session = ServiceUtil.validateSession(getThreadLocalRequest()); FolderDAO dao = (FolderDAO) Context.get().getBean(FolderDAO.class); try { List<Folder> folders = dao.findByNameAndParentId(name, dao.findById(folderId).getParentId()); if (folders.size() > 0 && folders.get(0).getId() != folderId) { return; } Folder folder = dao.findById(folderId); dao.initialize(folder); FolderHistory history = new FolderHistory(); history.setFilenameOld(folder.getName()); history.setPathOld(dao.computePathExtended(folderId)); history.setEvent(FolderEvent.RENAMED.toString()); history.setSession(session); folder.setName(name.trim()); dao.store(folder, history); } catch (Throwable t) { ServiceUtil.throwServerException(session, log, t); } }  @Override GUIFolder inheritRights(long folderId, long rightsFolderId); @Override void applyRights(GUIFolder folder, boolean subtree); @Override void applyMetadata(long parentId); @Override void delete(final long[] folderIds); static GUIFolder fromFolder(Folder folder, boolean computePath); @Override int[] computeStats(long folderId); static GUIFolder getFolder(Session session, long folderId); static GUIFolder getFolder(Session session, long folderId, boolean computePath); @Override GUIFolder getFolder(long folderId, boolean computePath, boolean computeDocs, boolean computeSubfolders); @Override void copyFolders(long[] folderIds, long targetId, boolean foldersOnly, boolean inheritSecurity); @Override void move(long[] folderIds, long targetId); @Override void rename(long folderId, String name); @Override GUIFolder save(GUIFolder folder); @Override GUIFolder create(GUIFolder newFolder, boolean inheritSecurity); @Override GUIFolder createAlias(long parentId, long foldRef); @Override void paste(long[] docIds, long folderId, String action); @Override void pasteAsAlias(long[] docIds, long folderId, String type); @Override GUIValue[] loadTemplates(); @Override void saveTemplates(GUIValue[] templates); @Override void applyTemplate(long folderId, long templateId, boolean inheritSecurity); @Override void restore(Long[] folderIds, long parentId); @Override void deleteFromTrash(Long[] ids); @Override void applyTags(long parentId); @Override void setFolderPagination(long folderId, Integer startRecord, Integer pageSize); @Override void applyGridLayout(long folderId); @Override void applyOCR(long parentId);  }### Answer:
@Test public void testRename() throws ServerException { Folder folder = folderDao.findById(6); Assert.assertEquals("folder6", folder.getName()); service.rename(6, "pluto"); folder = folderDao.findById(6); Assert.assertEquals("pluto", folder.getName()); }