### Question:
BoltStateMachineV1Context implements StateMachineContext { @Override public void handleFailure( Throwable cause, boolean fatal ) throws BoltConnectionFatality { machine.handleFailure( cause, fatal ); } BoltStateMachineV1Context( BoltStateMachine machine, BoltChannel boltChannel, BoltStateMachineSPI spi,
            MutableConnectionState connectionState, Clock clock ); @Override void authenticatedAsUser( String username, String userAgent ); @Override void handleFailure( Throwable cause, boolean fatal ); @Override boolean resetMachine(); @Override BoltStateMachineSPI boltSpi(); @Override MutableConnectionState connectionState(); @Override Clock clock(); @Override String connectionId();  }### Answer:
@Test void shouldHandleFailure() throws BoltConnectionFatality { BoltStateMachine machine = mock( BoltStateMachine.class ); BoltStateMachineV1Context context = newContext( machine, mock( BoltStateMachineSPI.class ) ); RuntimeException cause = new RuntimeException(); context.handleFailure( cause, true ); verify( machine ).handleFailure( cause, true ); }