latch.await();
consumer.close();
session.close();
ResponseCorrelator respCorr = (ResponseCorrelator) connection.getTransport();
MutexTransport mutexTrans = (MutexTransport) respCorr.getNext();
FailoverTransport failoverTrans = (FailoverTransport) mutexTrans.getNext();
Field stateTrackerField = FailoverTransport.class.getDeclaredField("stateTracker");
stateTrackerField.setAccessible(true);
ConnectionStateTracker stateTracker = (ConnectionStateTracker) stateTrackerField.get(failoverTrans);
Field statesField = ConnectionStateTracker.class.getDeclaredField("connectionStates");