### Question:
TransactionStateMachine implements StatementProcessor { @Override public void rollbackTransaction() throws KernelException { before(); try { ensureNoPendingTerminationNotice(); state = state.rollbackTransaction( ctx, spi ); } finally { after(); } } TransactionStateMachine( TransactionStateMachineSPI spi, AuthenticationResult authenticationResult, Clock clock ); State state(); @Override void beginTransaction( Bookmark bookmark ); @Override void beginTransaction( Bookmark bookmark, Duration txTimeout, Map<String,Object> txMetadata ); @Override StatementMetadata run( String statement, MapValue params ); @Override StatementMetadata run( String statement, MapValue params, Bookmark bookmark, Duration txTimeout, Map<String,Object> txMetaData ); @Override Bookmark streamResult( ThrowingConsumer<BoltResult, Exception> resultConsumer ); @Override Bookmark commitTransaction(); @Override void rollbackTransaction(); @Override boolean hasOpenStatement(); @Override void reset(); @Override void markCurrentTransactionForTermination(); @Override void validateTransaction(); @Override boolean hasTransaction();  }### Answer:
@Test void shouldTransitionToAutoCommitOnRollback() throws Exception { assertEquals( TransactionStateMachine.State.AUTO_COMMIT, TransactionStateMachine.State.EXPLICIT_TRANSACTION.rollbackTransaction( mutableState, stateMachineSPI ) ); }
@Test void shouldAllowRollbackInAutoCommit() throws Exception { assertEquals( TransactionStateMachine.State.AUTO_COMMIT, TransactionStateMachine.State.AUTO_COMMIT.rollbackTransaction( mutableState, stateMachineSPI ) ); }