### Question:
GraphDatabaseFacadeFactory { public GraphDatabaseFacade initFacade( File storeDir, Map<String,String> params, final Dependencies dependencies, final GraphDatabaseFacade graphDatabaseFacade ) { return initFacade( storeDir, Config.defaults( params ), dependencies, graphDatabaseFacade ); } GraphDatabaseFacadeFactory( DatabaseInfo databaseInfo,
            Function<PlatformModule,AbstractEditionModule> editionFactory ); GraphDatabaseFacade newFacade( File storeDir, Config config, final Dependencies dependencies ); GraphDatabaseFacade initFacade( File storeDir, Map<String,String> params, final Dependencies dependencies,
            final GraphDatabaseFacade graphDatabaseFacade ); GraphDatabaseFacade initFacade( File storeDir, Config config, final Dependencies dependencies,
            final GraphDatabaseFacade graphDatabaseFacade );  }### Answer:
@Test void shouldThrowAppropriateExceptionIfStartFails() { RuntimeException startupError = new RuntimeException(); GraphDatabaseFacadeFactory db = newFaultyGraphDatabaseFacadeFactory( startupError ); RuntimeException startException = assertThrows( RuntimeException.class, () -> db.initFacade( testDirectory.storeDir(), Collections.emptyMap(), deps, mockFacade ) ); assertEquals( startupError, Exceptions.rootCause( startException ) ); }
@Test void shouldThrowAppropriateExceptionIfBothStartAndShutdownFail() { RuntimeException startupError = new RuntimeException(); RuntimeException shutdownError = new RuntimeException(); GraphDatabaseFacadeFactory db = newFaultyGraphDatabaseFacadeFactory( startupError ); doThrow( shutdownError ).when( mockFacade ).shutdown(); RuntimeException initException = assertThrows( RuntimeException.class, () -> db.initFacade( testDirectory.storeDir(), Collections.emptyMap(), deps, mockFacade ) ); assertTrue( initException.getMessage().startsWith( "Error starting " ) ); assertEquals( startupError, initException.getCause() ); assertEquals( shutdownError, initException.getSuppressed()[0] ); }