### Question:
HibernateSystemMessageDAO extends HibernatePersistentObjectDAO<SystemMessage> implements SystemMessageDAO { public void deleteExpiredMessages(String recipient) { collectGarbage(findByRecipient(recipient, SystemMessage.TYPE_SYSTEM, null), true); } HibernateSystemMessageDAO(); @Override List<SystemMessage> findByRecipient(String recipient, int type, Integer read); @Override int getUnreadCount(String recipient, int type); void deleteExpiredMessages(String recipient); void deleteExpiredMessages(int type); @Override List<SystemMessage> findByMode(String mode); @Override List<SystemMessage> findByType(int type); @Override void initialize(SystemMessage message); @Override List<SystemMessage> findMessagesToBeSent(int type, int maxTrial); @Override boolean store(SystemMessage message);  }### Answer:
@Test public void testDeleteExpiredMessages() { dao.deleteExpiredMessages("sebastian"); Assert.assertNotNull(dao.findById(1)); dao.deleteExpiredMessages(SystemMessage.TYPE_SYSTEM); Assert.assertNotNull(dao.findById(1)); }