SequenceRepositoryImpl extends HibernateDaoSupport implements SequenceRepository { @Override public Long nextNumber() { return lockNumber().incrementAndGet(); }  @Override void initSequence(); @Override Long nextNumber();  }
@Test public void testNextNumber() throws Exception { sequenceRepository.initSequence(); testTransactionManager.commitTransaction(); testTransactionManager.beginTransaction(); for (long i = 1; i < 10; i++) { long number = sequenceRepository.nextNumber(); assertEquals(i, number); } }