### Question:
MessageServiceImpl extends RemoteServiceServlet implements MessageService { @Override public void delete(long[] ids) throws ServerException { ServiceUtil.validateSession(getThreadLocalRequest()); Context context = Context.get(); SystemMessageDAO dao = (SystemMessageDAO) context.getBean(SystemMessageDAO.class); for (long id : ids) { boolean deleted = false; try { deleted = dao.delete(id); } catch (PersistenceException e) { deleted = false; log.error(e.getMessage(), e); } if (!deleted) throw new ServerException("Messages have not been deleted"); } }  @Override void delete(long[] ids); @Override GUIMessage getMessage(long messageId, boolean markAsRead); @Override void save(GUIMessage message, long[] recipientIds); @Override GUIMessageTemplate[] loadTemplates(String language, String type); @Override void saveTemplates(GUIMessageTemplate[] templates); @Override void deleteTemplates(long[] ids); @Override void deleteTemplates(String name); @Override GUIMessageTemplate getTemplate(long templateId);  }### Answer:
@Test public void testDelete() throws ServerException { service.deleteTemplates("psw.rec1"); MessageTemplate template = templateDao.findById(2L); Assert.assertNotNull(template); template = templateDao.findById(500L); Assert.assertNotNull(template); service.deleteTemplates("test"); template = templateDao.findById(500L); Assert.assertNull(template); }