### Question:
HibernateFolderHistoryDAO extends HibernatePersistentObjectDAO<FolderHistory> implements FolderHistoryDAO { @Override public void cleanOldHistories(int ttl) { if (ttl > 0) { Date today = new Date(); GregorianCalendar cal = new GregorianCalendar(); cal.add(Calendar.DAY_OF_MONTH, -ttl); Date ldDate = cal.getTime(); try { int rowsUpdated = jdbcUpdate("UPDATE ld_folder_history SET ld_deleted = 1, ld_lastmodified = ?" + " WHERE ld_deleted = 0 AND ld_date < ?", today, ldDate); log.info("cleanOldHistories rows updated: " + rowsUpdated); } catch (Exception e) { if (log.isErrorEnabled()) log.error(e.getMessage(), e); } } } private  HibernateFolderHistoryDAO(); @Override List<FolderHistory> findByUserId(long userId); @Override List<FolderHistory> findByFolderId(long folderId); @Override List<FolderHistory> findNotNotified(Integer max); @Override void cleanOldHistories(int ttl); @Override List<FolderHistory> findByUserIdAndEvent(long userId, String event); @Override boolean store(FolderHistory entity); @Override List<FolderHistory> findByPath(String pathExpression, Date olderDate, Collection<String> events,
			Integer max); @Override List<FolderHistory> findByFolderIdAndEvent(long folderId, String event, Date oldestDate);  }### Answer:
@SuppressWarnings("rawtypes") @Test public void testCleanOldHistories() { dao.cleanOldHistories(5); FolderHistory history = dao.findById(3); Assert.assertNull(history); Collection histories = dao.findAll(); Assert.assertEquals(0, histories.size()); }