### Question:
HibernateAttributeSetDAO extends HibernatePersistentObjectDAO<AttributeSet> implements AttributeSetDAO { @Override public boolean delete(long id, int code) { if (!checkStoringAspect()) return false; boolean result = true; try { AttributeSet set = (AttributeSet) findById(id); if (set == null) return true; set.setDeleted(code); set.setName(set.getName() + "." + set.getId()); saveOrUpdate(set); optionsDao.deleteBySetIdAndAttribute(id, null); List<Template> templates = templateDao.findAll(set.getTenantId()); for (Template template : templates) templateDao.store(template); } catch (Throwable e) { log.error(e.getMessage(), e); result = false; } return result; } HibernateAttributeSetDAO(); @Override List<AttributeSet> findAll(); @Override List<AttributeSet> findAll(long tenantId); @Override AttributeSet findByName(String name, long tenantId); @Override boolean delete(long id, int code); @Override List<AttributeSet> findByType(int type, long tenantId); void setOptionsDao(AttributeOptionDAO optionsDao); @Override boolean store(AttributeSet set); void setTemplateDao(TemplateDAO templateDao); @Override Map<Long, AttributeSet> load(long tenantId); @Override Map<String, Attribute> findAttributes(long tenantId, Long setId);  }### Answer:
@Test public void testDelete() throws PersistenceException { Assert.assertTrue(dao.delete(1)); AttributeSet set = dao.findById(1); Assert.assertNull(set); }