public void testFailoverWithMultipleThreadsSendingMessages() throws Exception {
        adjustConfiguration(a,b,c); // removes FD/FD_ALL and MERGE protocols

        final int num_senders=5;

        MyReceiver rb=new MyReceiver("B"), rc=new MyReceiver("C");
        b.setReceiver(rb); c.setReceiver(rc);

        // insert DISCARD into A
        DISCARD discard=new DISCARD();
        discard.setLocalAddress(a.getAddress());
        discard.setDiscardAll(true);
        ProtocolStack stack=a.getProtocolStack();
        TP transport=stack.getTransport();
        stack.insertProtocol(discard,  ProtocolStack.Position.ABOVE, transport.getClass());
        
        MySender[] senders=new MySender[num_senders];
        for(int i=0; i < senders.length; i++) {
            senders[i]=new MySender((i+1) * 10, c);
            senders[i].start();
        }
        Util.sleep(1000);

        System.out.println("Injecting SUSPECT(A) into B and C");
        injectSuspectEvent(a.getAddress(), b,c);

        for(int i=0; i < 20; i++) {
            if(b.getView().size() == 2 && c.getView().size() == 2)
                break;
            Util.sleep(500);
        }
        System.out.println("B: " + b.getView() +"\nC: " + c.getView());
        assert b.getView().size() == 2 && c.getView().size() == 2;

        for(MySender sender: senders)
            sender.join(30000);
        System.out.println("senders are done");

        List<Integer> list_b=rb.getList(), list_c=rc.getList();
        System.out.println("\nB: " + list_b + "\nC: " + list_c);

        assert list_b.size() == num_senders * 2 && list_c.size() == num_senders * 2;
        System.out.println("OK: both B and C have the expected number of messages (" + num_senders *2 + ")");
        assert list_b.equals(list_c);
        System.out.println("OK: both list have the same ordering");

        // check that the first messages (11, 21, 31, 41, 51) are in the first half of both lists
        List<Integer> expected_list=Arrays.asList(11, 21, 31, 41, 51);
        List<Integer> list_bb=new ArrayList<>();
        for(int i=0; i < num_senders; i++)
            list_bb.add(list_b.get(i));

        Collections.sort(list_bb);

        System.out.println("Expected first half: " + expected_list + ", received: " + list_bb);
        assert expected_list.equals(list_bb);

        List<Integer> list_cc=new ArrayList<>();
        for(int i=0; i < num_senders; i++)
            list_cc.add(list_c.get(i));

        Collections.sort(list_cc);

        System.out.println("Expected first half: " + expected_list + ", received: " + list_cc);
        assert expected_list.equals(list_cc);

        System.out.println("OK: first set of messages of all threads were delivered before second set of messages");
    }