### Question:
TransactionalDatabaseTemplate implements DatabaseTemplate, TransactionalResource { @Override public GeneratedKeyHolder generateKeys(final SequenceKeyGenerator sequenceKeyGenerator) { return databaseTemplate.generateKeys(sequenceKeyGenerator); } TransactionalDatabaseTemplate(final DatabaseTemplate databaseTemplate); @Override void begin(); @Override void commit(); @Override T create(final T item, final PersistenceExceptionHandler<?>... persistenceExceptionHandlers); @Override T update(final T item, final PersistenceExceptionHandler<?>... persistenceExceptionHandlers); @Override void delete(final Item item, final PersistenceExceptionHandler<?>... persistenceExceptionHandlers); @Override T read(final ItemId itemId, final Class<T> itemClass); @Override Collection<T> fetch(final Query query, final Class<T> itemClass); @Override T fetchUnique(final Query query, final Class<T> itemClass); @Override GeneratedKeyHolder generateKeys(final SequenceKeyGenerator sequenceKeyGenerator); @Override void abort();  }### Answer:
@Test public void shouldGenerateKeys_withSequenceKeyGenerator() throws Exception { final SequenceKeyGenerator sequenceKeyGenerator = mock(SequenceKeyGenerator.class); final GeneratedKeyHolder mockGeneratedKeyHolder = mock(GeneratedKeyHolder.class); when(mockDatabaseTemplate.generateKeys(any(SequenceKeyGenerator.class))).thenReturn(mockGeneratedKeyHolder); final TransactionalDatabaseTemplate transactionalDatabaseTemplate = new TransactionalDatabaseTemplate( mockDatabaseTemplate); final GeneratedKeyHolder returnedGeneratedKeyHolder = transactionalDatabaseTemplate .generateKeys(sequenceKeyGenerator); verify(mockDatabaseTemplate).generateKeys(sequenceKeyGenerator); assertEquals(mockGeneratedKeyHolder, returnedGeneratedKeyHolder); }