### Question:
HibernateGenericDAO extends HibernatePersistentObjectDAO<Generic> implements GenericDAO { @Override public boolean delete(long genericId, int code) throws PersistenceException { assert (code != 0); if (!checkStoringAspect()) return false; boolean result = true; Generic generic = findById(genericId); if (generic != null) { generic.setType(generic.getType() + "." + generic.getId()); generic.setSubtype(generic.getSubtype() + "." + generic.getId()); generic.setDeleted(code); saveOrUpdate(generic); flush(); } return result; } HibernateGenericDAO(); @Override boolean delete(long genericId, int code); @Override Generic findByAlternateKey(String type, String subtype, Long qualifier, long tenantId); @Override List<Generic> findByTypeAndSubtype(String type, String subtype, Long qualifier, Long tenantId); @Override void initialize(Generic generic); @Override boolean store(Generic entity);  }### Answer:
@Test public void testDelete() throws PersistenceException { Assert.assertNotNull(dao.findById(1L)); dao.delete(1L); Assert.assertNull(dao.findById(1L)); }