@SuppressWarnings("unchecked")
@Test
public void messageDeliverTest() throws Exception {

    ActorRef<Runnable> runnableRef = mThread.bind(Runnable.class, mActorImpl);
    // Check that we provided correct proxy class
    Assert.assertSame(mProxy, runnableRef.tell());
    // Grab postman and check it
    ArgumentCaptor<MessageSender> postmanCaptor = ArgumentCaptor.forClass(MessageSender.class);
    Mockito.verify(mProxyFactory).newProxy(Mockito.<Class>any(), postmanCaptor.capture());
    final Message message = Mockito.mock(Message.class);
    final MessageSender postman = postmanCaptor.getValue();
    postman.deliver(message);
    ArgumentCaptor<Runnable> runnableCaptor = ArgumentCaptor.forClass(Runnable.class);
    Mockito.verify(mExecutor).execute(runnableCaptor.capture());
    Runnable runnable = runnableCaptor.getValue();
    Assert.assertNotNull(runnable);
    // Check that we tried to invoke method
    runnable.run();
    Mockito.verify(message).invoke(mActorImpl);
}