### Question:
HibernateSequenceDAO extends HibernatePersistentObjectDAO<Sequence> implements SequenceDAO { @Override public synchronized void reset(String sequence, long objectId, long tenantId, long value) { synchronized (SequenceDAO.class) { Sequence seq = findByAlternateKey(sequence, objectId, tenantId); if (seq == null) seq = new Sequence(); seq.setName(sequence); seq.setObjectId(objectId); seq.setTenantId(tenantId); seq.setLastReset(new Date()); seq.setValue(value); try { store(seq); } catch (PersistenceException e) { log.error(e.getMessage(), e); } } } private  HibernateSequenceDAO(); @Override synchronized void reset(String sequence, long objectId, long tenantId, long value); @Override synchronized long next(String sequence, long objectId, long tenantId, long increment); @Override synchronized long next(String sequence, long objectId, long tenantId); @Override long getCurrentValue(String sequence, long objectId, long tenantId); @Override List<Sequence> findByName(String name, long tenantId); @Override Sequence findByAlternateKey(String name, long objectId, long tenantId); @Override void delete(String name, long objectId, long tenantId); @Override boolean delete(long id, int code);  }### Answer:
@Test public void testReset() { dao.reset("test", 0L, Tenant.DEFAULT_ID, 5); for (int i = 1; i <= 20; i++) { Assert.assertEquals(i + 5, dao.next("test", 0L, Tenant.DEFAULT_ID)); } dao.reset("test", 0L, Tenant.DEFAULT_ID, 100); for (int i = 1; i <= 20; i++) { Assert.assertEquals(i + 100, dao.next("test", 0L, Tenant.DEFAULT_ID)); } dao.reset("test2", 0L, Tenant.DEFAULT_ID, 30); for (int i = 1; i <= 20; i++) { Assert.assertEquals(i + 30, dao.next("test2", 0L, Tenant.DEFAULT_ID)); } }