assertTrue("Remaining count: " + nodeLatch.getCount(), nodeLatch.await(30, SECONDS));
assertTrue("Remaining count: " + eventLatch.getCount(), eventLatch.await(30, SECONDS));
}
private static MembershipAdapter newAddMemberListener(final CountDownLatch eventLatch) {
return new MembershipAdapter() {
// flag to check listener is not called concurrently
final AtomicBoolean flag = new AtomicBoolean(false);
public void memberAdded(MembershipEvent membershipEvent) {