title: Count number of facts in sliding window with Drools Fusion
body: <p>I need to write a rule that counts the number of Facts I've received in my stream over the last 10 seconds if they match a certain criteria.</p>
  
  <p>So, for instance, if 2 black cars pass through an intersection in the last 10 seconds I want to alert someone. </p>
  
  <p>I have the following rule:</p>
  
  <pre><code>rule "check black cars in 10 seconds" dialect "java"
  when
  
      $car : Car(color == Color.BLACK) over window:time(10s);
  then
  
      System.out.println("got something");
  </code></pre>
  
  <p>This is working when I pass in a Black car, however, I don't want it to fire unless there are 2 black cars. I cannot find a good example of this. </p>
  
  <p>Thanks.</p>