import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.googlecode.cqengine.ConcurrentIndexedCollection;
import com.googlecode.cqengine.IndexedCollection;
import com.googlecode.cqengine.codegen.AttributeBytecodeGenerator;
import com.googlecode.cqengine.query.parser.sql.SQLParser;
import com.googlecode.cqengine.resultset.ResultSet;

import lombok.AllArgsConstructor;
import lombok.Data;


@AllArgsConstructor
@Data
class Car {
    public String name;
    public List<String> featureBulletPoints;
    public Map<String, String> randomMap;

}
public class Activity {

    public static void main(String args[]) {
        List<Car> sampleList = new ArrayList<>();
        sampleList.add(new Car("mercedes", ImmutableList.of("att", "mehngi"), ImmutableMap.of("a", "bmwMap")));
        sampleList.add(new Car("bmw", ImmutableList.of("nice"), ImmutableMap.of("b", "set")));
        sampleList.add(new Car("ferrari", ImmutableList.of("bahli att", "sports"), ImmutableMap.of("rando", "anothe")));
        sampleList.add(new Car("rolls royce", ImmutableList.of("sirra", "kuch bhi"), ImmutableMap.of("blahh", "hola")));
        IndexedCollection<Car> indexedCollection = new ConcurrentIndexedCollection<Car>();
        indexedCollection.addAll(sampleList);
        SQLParser<Car> sqlParser = SQLParser.forPojoWithAttributes(Car.class, AttributeBytecodeGenerator.createAttributes(Car.class));
        ResultSet<Car> results = sqlParser.retrieve(indexedCollection, "SELECT * FROM indexedCollection WHERE name = 'mercedes'");
        for(Car car : results) {
            System.out.println(car);
        }
        results.close();
    }

}
