### Question:
MessageSenderImpl implements MessageSender<T> { @Override public void sendDelayedMessage(final T message, final int delaySeconds) throws MessageSendException { messageQueue.sendDelayedMessage(message, delaySeconds); } MessageSenderImpl(final MessageQueue<T> messageQueue); @Override void send(final T message); @Override void sendDelayedMessage(final T message, final int delaySeconds);  }### Answer:
@Test public void shouldSendDelayedMessage_withMessageAndDelay() { final int delaySeconds = randomInt(100); messageSenderImpl.sendDelayedMessage(mockMessage, delaySeconds); verify(mockMessageQueue).sendDelayedMessage(mockMessage, delaySeconds); }
@Test public void shouldThrowMessageSendException_onExceptionFromSendDelayedMessage() { final int delaySeconds = randomInt(100); final MessageSendException messageSendException = mock(MessageSendException.class); doThrow(messageSendException).when(mockMessageQueue).sendDelayedMessage(any(Message.class), anyInt()); MessageSendException thrownException = null; try { messageSenderImpl.sendDelayedMessage(mockMessage, delaySeconds); } catch (final MessageSendException e) { thrownException = e; } assertSame(messageSendException, thrownException); }