### Question:
SoapSearchService extends AbstractService implements SearchService { @Override public WSFolder[] findFolders(String sid, String name) throws Exception { User user = validateSession(sid); FolderDAO folderDao = (FolderDAO) Context.get().getBean(FolderDAO.class); List<Folder> folders = folderDao.find(name, user.getTenantId()); WSFolder[] wsFolders = new WSFolder[folders.size()]; for (int i = 0; i < folders.size(); i++) { try { checkReadEnable(user, folders.get(i).getId()); } catch (Exception e) { continue; } folderDao.initialize(folders.get(i)); wsFolders[i] = WSFolder.fromFolder(folders.get(i)); } return wsFolders; }  @Override WSSearchResult find(String sid, WSSearchOptions opt); @Override WSDocument[] findByFilename(String sid, String filename); @Override WSFolder[] findFolders(String sid, String name);  }### Answer:
@Test public void testFindFolders() throws Exception { WSFolder[] folders = searchServiceImpl.findFolders("", "menu.admin"); Assert.assertNotNull(folders); Assert.assertEquals(4, folders.length); List<WSFolder> foldersList = Arrays.asList(folders); Assert.assertEquals(80, foldersList.get(0).getId()); Assert.assertEquals(99, foldersList.get(1).getId()); folders = searchServiceImpl.findFolders("", "menu.adminxx"); Assert.assertEquals(1, folders.length); foldersList = Arrays.asList(folders); Assert.assertEquals(80, foldersList.get(0).getId()); folders = searchServiceImpl.findFolders("", "qqqxxx"); Assert.assertNotNull(folders); Assert.assertEquals(0, folders.length); }