@Test(expected = UniqueIndex.UniqueConstraintViolatedException.class)
public void testDuplicateObjectDetection_MultiValueAttribute() {

    IndexedCollection<Car> cars = new ConcurrentIndexedCollection<Car>();
    // Add some indexes...
    cars.addIndex(UniqueIndex.onAttribute(Car.FEATURES));
    // Add some objects to the collection...
    cars.add(new Car(1, "ford focus", "foo", Arrays.asList("spare tyre", "sunroof")));
    cars.add(new Car(2, "ford taurus", "bar", Arrays.asList("radio", "cd player")));
    // Try to add another car which has a cd player, when one car already has a cd player...
    cars.add(new Car(3, "honda civic", "baz", Arrays.asList("cd player", "bluetooth")));
}