public void testMergeWithDifferentPartitions() throws Exception {
        d=createChannel(a);
        d.setName("D");
        rd=new MyReceiver("D", d);
        d.setReceiver(rd);
        modifyConfigs(d);
        d.connect("OverlappingMergeTest");

        // Inject view {A,C,B} into A, B and C:
        View new_view=View.create(a.getAddress(), 4, a.getAddress(), c.getAddress(), b.getAddress());
        System.out.println("\n ==== Injecting view " + new_view + " into A, B and C ====");
        injectView(new_view,false,a,b,c);
        assert Util.isCoordinator(a);
        assert !Util.isCoordinator(b);
        assert !Util.isCoordinator(c);

        View view_d=View.create(b.getAddress(), 4, b.getAddress(), a.getAddress(), c.getAddress(), d.getAddress());
        System.out.println("\n ==== Injecting view " + view_d + " into D ====\n");
        injectView(view_d, false, d);
        assert !Util.isCoordinator(d);

        for(JChannel ch: Arrays.asList(a,b,c,d))
            System.out.println(ch.getName() + ": " + ch.getView());


        // start merging
        Event merge_evt=createMergeEvent(a,b,c,d);

        System.out.println("\n==== Injecting a merge event into members ====");

        for(JChannel ch: new JChannel[]{a,b,c,d}) {
            GMS gms=ch.getProtocolStack().findProtocol(GMS.class);
            gms.setLevel("trace");
        }

        injectMergeEvent(merge_evt,a,b,c,d);

        for(int i=0; i < 20; i++) {
            if(a.getView().size() == 4 && b.getView().size() == 4 && c.getView().size() == 4 && d.getView().size() == 4)
                break;
            Util.sleep(2000);
            injectMergeEvent(createMergeEvent(a,b,c,d), a,b,c,d);
        }

        for(JChannel ch: Arrays.asList(a,b,c,d))
            System.out.println(ch.getName() + ": " + ch.getView() + " (coord=" + isCoord(ch) + ")");

        for(JChannel ch: Arrays.asList(a,b,c,d)) {
            assert ch.getView().size() == 4 : ch.getName() + ": view is " + ch.getView();
            GMS gms=ch.getProtocolStack().findProtocol(GMS.class);
            gms.setLevel("warn");
        }
        System.out.println("\n");
    }