public void testConcurrentJoining() throws Exception {
        for(int i=0; i < NUM; i++) {
            threads[i]=new MyThread(channels[i], i+1, barrier);
            threads[i].start();
        }

        barrier.await(); // causes all threads to call Channel.connect()
        System.out.println("*** Starting the connect phase ***");

        long target_time=System.currentTimeMillis() + 60000L;
        while(System.currentTimeMillis() < target_time) {
            View view=channels[0].getView();
            if(view != null) {
                int size=view.size();
                System.out.println("channel[0].view has " + size + " members (expected: " + NUM + ")");
                if(size >= NUM)
                    break;
            }
            Util.sleep(1000L);
        }

        for(JChannel ch: channels) {
            View view=ch.getView();
            if(view != null)
                System.out.println(ch.getName() + ": size=" + view.size() + ", view-id: " + view.getViewId());
        }

        for(JChannel ch: channels) {
            View view=ch.getView();
            int size=view != null? view.size() : 0;
            assert view != null && size == NUM : "view doesn't have size of " + NUM + " (has " + size + "): " + view;
        }
    }