results = workingMemory.getQueryResults( "query-1" );
assertEquals( 2,
results.size() );
QueryResult result = results.get( 0 );
assertEquals( 1,
result.size() );
assertEquals( stilton1,
result.get( 0 ) );
result = results.get( 1 );
assertEquals( 1,
result.size() );
assertEquals( stilton2,
result.get( 0 ) );
int i = 0;
for ( final Iterator it = results.iterator(); it.hasNext(); ) {
result = (QueryResult) it.next();
assertEquals( 1,
result.size() );
if ( i == 1 ) {
assertSame( stilton2,
result.get( 0 ) );
} else {
assertSame( stilton1,
result.get( 0 ) );
}
i++;
}
workingMemory.retract( handle1 );