@Override
    public void yield() throws InterruptedException {
        Mail mail = mailbox.take(priority);
        try {
            mail.run();
        } catch (Exception ex) {
            throw WrappingRuntimeException.wrapIfNecessary(ex);
        }
    }
@Test
    void testYield() throws Exception {
        final AtomicReference<Exception> exceptionReference = new AtomicReference<>();
        final TestRunnable testRunnable = new TestRunnable();
        final Thread submitThread =
                new Thread(
                        () -> {
                            try {
                                mailboxExecutor.execute(testRunnable, "testRunnable");
                            } catch (Exception e) {
                                exceptionReference.set(e);
                            }
                        });

        submitThread.start();
        mailboxExecutor.yield();
        submitThread.join();

        assertThat(exceptionReference.get()).isNull();
        assertThat(testRunnable.wasExecutedBy()).isEqualTo(Thread.currentThread());
    }