### Question:
BoltStateMachineV1 implements BoltStateMachine { @Override public void close() { try { boltChannel.close(); } finally { connectionState.markClosed(); resetStatementProcessor(); } } BoltStateMachineV1( BoltStateMachineSPI spi, BoltChannel boltChannel, Clock clock ); @Override void process( RequestMessage message, BoltResponseHandler handler ); @Override void markFailed( Neo4jError error ); @Override void interrupt(); @Override void validateTransaction(); @Override void handleExternalFailure( Neo4jError error, BoltResponseHandler handler ); @Override boolean isClosed(); @Override void close(); @Override String id(); @Override void markForTermination(); @Override boolean shouldStickOnThread(); @Override boolean hasOpenStatement(); @Override boolean reset(); @Override void handleFailure( Throwable cause, boolean fatal ); BoltStateMachineState state(); StatementProcessor statementProcessor(); MutableConnectionState connectionState();  }### Answer:
@Test public void shouldRollbackOpenTransactionOnClose() throws Throwable { final BoltStateMachine machine = newMachineWithTransaction(); machine.close(); assertThat( machine, hasNoTransaction() ); }
@Test public void shouldCloseBoltChannelWhenClosed() { BoltStateMachineV1SPI spi = mock( BoltStateMachineV1SPI.class ); BoltChannel boltChannel = mock( BoltChannel.class ); BoltStateMachine machine = new BoltStateMachineV1( spi, boltChannel, Clock.systemUTC() ); machine.close(); verify( boltChannel ).close(); }