while (System.currentTimeMillis() - start < 1000);
    public void assertExchangeCompleted() throws Exception {        long start = System.currentTimeMillis();        MessageExchange active = null;        while (true) {            synchronized (exchanges) {                for (Iterator it = exchanges.values().iterator(); it.hasNext();) {                    active = null;                    MessageExchange me = (MessageExchange) it.next();                    if (me.getStatus() == ExchangeStatus.ACTIVE) {                        active = me;                        break;                    }                }                if (active == null) {                    break;                }                long remain = timeout - (System.currentTimeMillis() - start);                if (remain <= 0) {                    assertTrue("Exchange is ACTIVE: " + active, active.getStatus() != ExchangeStatus.ACTIVE);                } else {                    exchanges.wait(remain);                }            }        }        while (System.currentTimeMillis() - start < 1000);    }