public class Verifier
{
    public static final String EXAMPLE_DATA = "example.txt";
    public static final String[] EXAMPLE_MATCH = { "ababbb", "abbbab" };

    public Verifier (boolean debug)
    {
        _debug = debug;
    }

    public boolean verify ()
    {
        Rule[] rules = Util.loadRules(EXAMPLE_DATA, _debug);
        Message[] messages = Util.loadMessages(EXAMPLE_DATA, _debug);

        if (_debug)
        {
            System.out.println("Loaded:\n");
            
            for (int i = 0; i < rules.length; i++)
                System.out.println(rules[i]);

            for (int j = 0; j < messages.length; j++)
                System.out.println(messages[j]);
        }

        Matcher m = new Matcher(rules, _debug);
        Message[] msgs = m.matchRule(0, messages);

        System.out.println("\nGot back "+msgs);
        
        // check messages are equivalent even if different orders

        if ((msgs != null) && (msgs.length == EXAMPLE_MATCH.length))
        {
            for (int i = 0; i < EXAMPLE_MATCH.length; i++)
            {
                boolean found = false;

                for (int j = 0; (j < msgs.length) && !found; j++)
                {
                    if (msgs[j].equals(EXAMPLE_MATCH[i]))
                        found = true;
                }

                if (!found)
                    return false;
            }

            return true;
        }

        return false;
    }

    private boolean _debug;
}
@@ -752,36 +752,50 @@
     
-Message%5B%5D msgs = m.matchRule
+long matching = m.numberOfMatchingMessages
 (0, 
@@ -852,592 +852,17 @@
  %22+m
-sgs);%0A        %0A        // check messages are equivalent even if different orders%0A%0A        if ((msgs != null) && (msgs.length == EXAMPLE_MATCH.length))%0A        %7B%0A            for (int i = 0; i %3C EXAMPLE_MATCH.length; i++)%0A            %7B%0A                boolean found = false;%0A%0A                for (int j = 0; (j %3C msgs.length) && !found; j++)%0A                %7B%0A                    if (msgs%5Bj%5D.equals(EXAMPLE_MATCH%5Bi%5D))%0A                        found = true;%0A                %7D%0A%0A                if (!found)%0A                    return false;%0A            %7D%0A%0A            return true;%0A        %7D
+atching);
 %0A%0A  

Update Verifier.java