public boolean isIdle() {
        return !mailboxProcessor.isDefaultActionAvailable()
                && !mailbox.hasMail()
                && mailbox.getState().isAcceptingMails();
    }
@Test
    void testIsIdle() throws Exception {
        MailboxProcessor processor =
                new MailboxProcessor(MailboxDefaultAction.Controller::suspendDefaultAction);
        MailboxExecutorImpl executor =
                (MailboxExecutorImpl) processor.getMailboxExecutor(DEFAULT_PRIORITY);

        assertThat(executor.isIdle()).isFalse();

        processor.runMailboxStep(); // let the default action suspend mailbox
        processor.allActionsCompleted();
        // process allActionsCompleted() mail or any other remaining control mails
        while (processor.runMailboxStep()) {}

        assertThat(executor.isIdle()).isTrue();

        executor.execute(() -> {}, "");
        assertThat(executor.isIdle()).isFalse();

        processor.mailbox.drain();
        processor.mailbox.quiesce();
        assertThat(executor.isIdle()).isFalse();
    }