final String str = channel.readOutbound();
if (str == null) {
Thread.sleep(200);
} else {
// The notification destined for the connected channel
final NotificationMessageImpl notification = responseToType(str, NotificationMessageImpl.class);
assertThat(notification.getMessageType(), is(MessageType.Type.NOTIFICATION));
assertThat(notification.getAcks().size(), is(1));
assertThat(notification.getAcks().iterator().next().getChannelId(), equalTo(channelId));
if (version != null) {
assertThat(notification.getAcks().iterator().next().getVersion(), equalTo(version));
} else {
final Date date = new Date(notification.getAcks().iterator().next().getVersion());
assertThat(date, is(notNullValue()));
}
countDownLatch.countDown();
}
}