### Question:
MailboxProcessor { public MailboxExecutorService getMailboxExecutor() { return mailboxExecutor; } MailboxProcessor(MailboxDefaultAction mailboxDefaultAction); MailboxExecutorService getMailboxExecutor(); void open(); void prepareClose(); void close(); void runMailboxLoop(); void reportThrowable(Throwable throwable); void allActionsCompleted();  }### Answer:
@Test public void testRejectIfNotOpen() { MailboxProcessor mailboxProcessor = new MailboxProcessor((ctx) -> {}); try { mailboxProcessor.getMailboxExecutor().execute(() -> {}); Assert.fail("Should not be able to accept runnables if not opened."); } catch (RejectedExecutionException expected) { } }