### Question:
BlockingBootstrapper implements Bootstrapper { @Override public final int start( File homeDir, Optional<File> configFile, Map<String, String> configOverrides ) { int status = wrapped.start( homeDir, configFile, configOverrides ); if ( status != ServerBootstrapper.OK ) { return status; } try { latch.await(); } catch ( InterruptedException e ) { Thread.currentThread().interrupt(); } return wrapped.stop(); } BlockingBootstrapper( Bootstrapper wrapped ); @Override final int start( File homeDir, Optional<File> configFile, Map<String, String> configOverrides ); @Override int stop();  }### Answer:
@Test public void shouldNotBlockIfTheWrappedStartIsUnsuccessful() throws Throwable { AtomicInteger status = new AtomicInteger(); AtomicBoolean exited = new AtomicBoolean( false ); BlockingBootstrapper bootstrapper = new BlockingBootstrapper( new Bootstrapper() { @Override public int start( File homeDir, Optional<File> configFile, Map<String, String> configOverrides ) { return 1; } @Override public int stop() { return 0; } } ); new Thread( () -> { status.set( bootstrapper.start( homeDir.directory( "home-dir" ), Optional.empty(), Collections.emptyMap() ) ); exited.set( true ); } ).start(); assertEventually( "Blocked unexpectedly", exited::get, is( true ), 10, TimeUnit.SECONDS ); assertThat( "Bootstrapper did not propagate exit status", status.get(), is( 1 ) ); }