<div dir="ltr">I&#39;ve got some pretty simple code that looks something like:<div><br></div><div>if (!exhange.isDispatched()) {</div><div>    exchange.dispatch(() -&gt; {</div><div>        assert exchange.isDispatched();</div><div>         // more stuff....</div><div>    });</div><div>}</div><div><br></div><div>but the assert fails. That is, when dispatch calls my runnable isDispatched is not true.</div><div><br></div><div>I believe I have a bug somewhere with how/when dispatches are happening so I&#39;ve littered my code with such asserts and they fail reliably even when I&#39;m quite sure the exchange has been dispatched (e.g. when it is literally the first call in a Runnable passed to to the dispatch() method).</div><div><br></div><div>What am I doing wrong?</div></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr"><div style="font-size:small"><div style="font-size:13px;line-height:19.5px">CTO, Analytic Spot</div><div style="font-size:13px;line-height:19.5px">44 West Broadway #222</div><div style="font-size:13px;line-height:19.5px">Eugene, OR 97401<br></div><div style="font-size:13px;line-height:19.5px"><a href="http://analyticspot.com/" style="z-index: 0;">analyticspot.com</a> <span style="color:rgb(127,127,127);font-family:&#39;helvetica neue&#39;;font-size:11px;line-height:normal">• </span>425-296-6556</div></div><div style="font-size:small"><span style="line-height:19.5px"><a href="http://www.linkedin.com/in/oliverdain" style="z-index: 0;">www.linkedin.com/in/oliverdain</a></span></div></div></div>