@SuppressWarnings("unchecked")
@Test
public void sendTransaction_sendToNewHandler_invalidHandlerExists() {

    DefaultActorThread thread = createThread();
    ActorHandlerBase handler = createHandler(-1, null);
    Mockito.doReturn(false).when(handler).sendTransaction(Mockito.<Transaction>any());
    thread.mHandler = handler;
    Transaction transaction = Transaction.<Object>obtain(mImpl, mMessage, mFailureHandler);
    thread.sendTransaction(transaction);
    Mockito.verify(thread.mHandler).sendTransaction(transaction);
    Assert.assertNotSame(handler, thread.mHandler);
}