// asserting the sensor object
final RandomNumber rn = new RandomNumber();
rn.setValue( 10 );
workingMemory.insert( rn );
final Guess guess = new Guess();
guess.setValue( new Integer( 5 ) );
final FactHandle handle = workingMemory.insert( guess );
workingMemory.fireAllRules();
// HIGHER
assertEquals( 1,
list.size() );
assertEquals( "HIGHER",
list.get( 0 ) );
guess.setValue( new Integer( 15 ) );
workingMemory.update( handle,
guess );
workingMemory.fireAllRules();
// LOWER
assertEquals( 2,
list.size() );
assertEquals( "LOWER",
list.get( 1 ) );
guess.setValue( new Integer( 10 ) );
workingMemory.update( handle,
guess );
workingMemory.fireAllRules();