@Test(expected = IllegalStateException.class)
public void testEnsureMutable() {

    CollectionQueryEngine<Car> queryEngine = new CollectionQueryEngine<Car>();
    queryEngine.init(emptyObjectStore(), queryOptionsWithOnHeapPersistence());
    queryEngine.addIndex(createImmutableIndex(), noQueryOptions());
    queryEngine.addAll(ObjectSet.fromCollection(Collections.singleton(CarFactory.createCar(1))), noQueryOptions());
}