title: Drool does not sort numbers correctly
body: <p>I am new to Drools and am trying to get the sample program to work.
  This sample is given in the drools documentation <a href="http://docs.jboss.org/drools/release/5.5.0.Final/drools-expert-docs/html_single/index.html#d0e9542" rel="nofollow">http://docs.jboss.org/drools/release/5.5.0.Final/drools-expert-docs/html_single/index.html#d0e9542</a>. 
  This drool rule is expected to sort integers. I just changed the numbers from what are given in the sample and they do not get sorted as expected.
  Tried using drools version 5.5.0, 5.5.1 and the master 6.0.0, but got the same wrong results.</p>
  
  <h2>Following is the main code:</h2>
  
  <pre>
      package com.sample;
  
      public class Example2 {
        public static void main(String[] args) throws Exception {
          Number[] numbers = new Number[] { wrap(5), wrap(6), wrap(4), wrap(1), wrap(2) };
          new RuleRunner().runRules(new String[] { "Example3.drl" }, numbers);
        }
  
        private static Integer wrap(int i) {
          return new Integer(i);
        }
      }
  </pre>
  
  <p>The RuleRunner class is the same as given in the example and I do not think I should give that here, since it will clutter the question. It simply creates the KnowledgeBase, stateful session, inserts the facts as given in the 'numbers' array above and then calls fireAllRules method on the session.</p>
  
  <h2>The rule file (Example3.drl) is:</h2>
  
  <p><br/>
  rule "Rule 04"<br/>
  &nbsp;&nbsp;&nbsp;&nbsp;dialect "mvel"<br/>
  &nbsp;&nbsp;when<br/>
  &nbsp;&nbsp;&nbsp;&nbsp;$number : Number()<br/>
  &nbsp;&nbsp;&nbsp;&nbsp;not Number(intValue &lt; $number.intValue)<br/>
  &nbsp;&nbsp;then<br/>
  &nbsp;&nbsp;&nbsp;&nbsp;System.out.println("Number found with value: " + $number.intValue());<br/>
  &nbsp;&nbsp;&nbsp;&nbsp;retract($number);<br/>
  end<br/></p>
  
  <h2>The output I get is as follows:</h2>
  
  <pre>
  Loading file: Example3.drl
  Inserting fact: 5
  Inserting fact: 6
  Inserting fact: 4
  Inserting fact: 1
  Inserting fact: 2
  Number found with value: 1
  Number found with value: 4
  Number found with value: 2
  Number found with value: 5
  Number found with value: 6
  </pre>
  
  <h2>Not the correct expected ascending sorted order.</h2>
  
  <p>What might I be doing wrong? I cannot imagine that the drools rule engine would be broken at this basic level.</p>