@Test
public void testOnSemiUniqueAttribute() throws Exception{

    HashIndex<Integer, Car> hashIndex = HashIndex.onSemiUniqueAttribute(Car.CAR_ID);
    // Validate that the HashIndex was configured with CompactValueSetFactory.
    // We have to use reflection to do this
    // because the valueSetFactory has protected access in AbstractMapBasedAttributeIndex.
    // This is a bit hacky, but OTOH we should not break encapsulation of AbstractMapBasedAttributeIndex...
    Field valueSetFactoryField = AbstractMapBasedAttributeIndex.class.getDeclaredField("valueSetFactory");
    valueSetFactoryField.setAccessible(true);
    Assert.assertTrue("HashIndex should be configured with CompactValueSetFactory",
            valueSetFactoryField.get(hashIndex) instanceof HashIndex.CompactValueSetFactory);
}