### Question:
ThreadPool extends ThreadPoolExecutor { @Override public void setRejectedExecutionHandler(RejectedExecutionHandler handler) { if (handler instanceof RejectionHandler) { super.setRejectedExecutionHandler(handler); } else { throw new IllegalArgumentException(handler.getClass() + " must be an instance of " + RejectionHandler.class); } } private  ThreadPool(String name,
                       int corePoolSize,
                       int maximumPoolSize,
                       int growthThreshold,
                       int growthRate,
                       long keepAliveTime,
                       TimeUnit keepAliveTimeUnit,
                       ThreadFactory threadFactory,
                       WorkQueue queue,
                       RejectionHandler rejectionHandler); static Optional<ThreadPool> asThreadPool(ExecutorService executor); String getName(); int getQueueCapacity(); float getAverageQueueSize(); int getPeakQueueSize(); int getCompletedTasks(); int getFailedTasks(); int getTotalTasks(); int getActiveThreads(); float getAverageActiveThreads(); int getRejectionCount(); boolean isFixedSize(); @Override WorkQueue getQueue(); int getQueueSize(); @Override void setRejectedExecutionHandler(RejectedExecutionHandler handler); @Override RejectionHandler getRejectedExecutionHandler(); @Override void setMaximumPoolSize(int maximumPoolSize); @Override String toString(); @Override void shutdown();  }### Answer:
@Test void testSetRejectionHandlerRequiresRejectionPolicy() { pool = newPool(2, 2, 100, 25); assertThrows(IllegalArgumentException.class, () -> pool.setRejectedExecutionHandler((r, executor) -> { })); }