### Question:
DynamicTaskExecutor implements TaskExecutor<LOCAL> { @Override public void submit( Task<LOCAL> task ) { assertHealthy(); try { while ( !queue.offer( task, 10, MILLISECONDS ) ) { assertHealthy(); } } catch ( InterruptedException e ) { Thread.currentThread().interrupt(); } } DynamicTaskExecutor( int initialProcessorCount, int maxProcessorCount, int maxQueueSize,
            ParkStrategy parkStrategy, String processorThreadNamePrefix );  DynamicTaskExecutor( int initialProcessorCount, int maxProcessorCount, int maxQueueSize,
            ParkStrategy parkStrategy, String processorThreadNamePrefix, Supplier<LOCAL> initialLocalState ); @Override int processors( int delta ); @Override void submit( Task<LOCAL> task ); @Override void assertHealthy(); @Override void receivePanic( Throwable cause ); @Override synchronized void close();  }### Answer:
@Test public void shouldShutDownOnTaskFailure() throws Exception { TaskExecutor<Void> executor = new DynamicTaskExecutor<>( 30, 0, 5, PARK, getClass().getSimpleName() ); IOException exception = new IOException( "Test message" ); FailingTask task = new FailingTask( exception ); executor.submit( task ); task.latch.await(); task.latch.release(); assertExceptionOnSubmit( executor, exception ); }