@Test
public void testGetCountOfDistinctKeys(){

    ConnectionManager connectionManager = temporaryInMemoryDatabase.getConnectionManager(true);
    SQLiteIndex<String, Car, Integer> offHeapIndex = SQLiteIndex.onAttribute(
            Car.MANUFACTURER,
            Car.CAR_ID,
            new SimpleAttribute<Integer, Car>() {
                @Override
                public Car getValue(Integer carId, QueryOptions queryOptions) {
                    return CarFactory.createCar(carId);
                }
            }
    );
    offHeapIndex.addAll(createObjectSetOfCars(20), createQueryOptions(connectionManager));
    Assert.assertEquals(Integer.valueOf(4), offHeapIndex.getCountOfDistinctKeys(createQueryOptions(connectionManager)));
}