void (ExecutorService service) { UsefulTestCase.assertThrows(IncorrectOperationException.class, "You must not call this method on the global app pool", () -> service.shutdown()); UsefulTestCase.assertThrows(IncorrectOperationException.class, "You must not call this method on the global app pool", () -> service.shutdownNow()); if (service instanceof ThreadPoolExecutor) { UsefulTestCase.assertThrows(IncorrectOperationException.class, "You must not call this method on the global app pool", () -> ((ThreadPoolExecutor)service).setThreadFactory(Thread::new)); UsefulTestCase.assertThrows(IncorrectOperationException.class, "You must not call this method on the global app pool", () -> ((ThreadPoolExecutor)service).setCorePoolSize(0)); } }