PromiseProxy extends Promise<R> implements Message<T, R>, ActionHandle, ResultListener<R> { @Override public String toString() { return mMessage.toString(); } PromiseProxy(@NonNull MessageSender sender, @NonNull Message<T, R> message); @Override void thenNothing(); @NonNull @Override ActionHandle then(@NonNull ResultListener<R> listener); @NonNull @Override ActionHandle then(@NonNull ActorThread thread, @NonNull ResultListener<R> listener); @Nullable @Override R get(); @Override void onResult(@Nullable R result); @Override void forget(); @Override Promise<R> invoke(@NonNull T impl); @NonNull @Override ActorInvokeException exception(); @Override String toString();  }
@SuppressWarnings("ResultOfMethodCallIgnored") @Test public void toString_returnFromMessage_always() { Mockito.doReturn("TEXT FROM MESSAGE").when(mMessage).toString(); PromiseProxy promise = new PromiseProxy(mSender, mMessage); Assert.assertEquals("TEXT FROM MESSAGE", promise.toString()); }