* Tests removing the criteria by its index and protecting the last criteria from
* being removed.
*/
public void testRemoveCriteria()
{
IQuery query = new DummyStringQuery();
builder.setQuery(query);
builder.addEmptyCriteria();
ICriteria defaultCriteria = query.getCriteriaAt(0);
builder.removeCriteria(0);
assertEquals("Criteria should be removed.", 1, query.getCriteriaCount());
assertFalse("Wrong criteria removed.", defaultCriteria == query.getCriteriaAt(0));
builder.removeCriteria(0);
assertEquals("The last criteria should not be removed.", 1, query.getCriteriaCount());
}