### Question:
ReentrantBoundedExecutor implements Executor { ReentrantBoundedExecutor(Executor coreExecutor, int maxThreads) { this.boundedExecutor = new BoundedExecutor(requireNonNull(coreExecutor, "coreExecutor is null"), maxThreads); this.coreExecutor = coreExecutor; } ReentrantBoundedExecutor(Executor coreExecutor, int maxThreads); @Override void execute(Runnable task);  }### Answer:
@Test public void testReentrantBoundedExecutor() throws ExecutionException, InterruptedException { AtomicInteger callCounter = new AtomicInteger(); SettableFuture<Object> future = SettableFuture.create(); ExecutorService executor = newCachedThreadPool(); try { Executor reentrantExecutor = new ReentrantBoundedExecutor(executor, 1); reentrantExecutor.execute(() -> { callCounter.incrementAndGet(); reentrantExecutor.execute(() -> { callCounter.incrementAndGet(); future.set(null); }); try { future.get(); } catch (Exception ignored) { } }); future.get(); SettableFuture<Object> secondFuture = SettableFuture.create(); reentrantExecutor.execute(() -> secondFuture.set(null)); secondFuture.get(); assertEquals(callCounter.get(), 2); } finally { executor.shutdownNow(); } }