class MailboxExecutorImpl implements MailboxExecutor {

	@Override
	public boolean tryYield() throws IllegalStateException {
		checkIsMailboxThread();
		try {
			Optional<Runnable> runnableOptional = mailbox.tryTakeMail();
			if (runnableOptional.isPresent()) {
				runnableOptional.get().run();
				return true;
			} else {
				return false;
			}
		} catch (MailboxStateException e) {
			throw new IllegalStateException("Mailbox can no longer supply runnables for yielding.", e);
		}
	}

	public  MailboxExecutorImpl(@Nonnull Mailbox mailbox);
	public  MailboxExecutorImpl(@Nonnull Mailbox mailbox, @Nonnull Thread taskMailboxThread);

}