// given
getMorphia().map(UniqueIndexOnValue.class);
getDs().ensureIndexes();
final long value = 7L;
final UniqueIndexOnValue entityWithUniqueName = new UniqueIndexOnValue();
entityWithUniqueName.setValue(value);
getDs().save(entityWithUniqueName);
// when
final UniqueIndexOnValue entityWithSameName = new UniqueIndexOnValue();
entityWithSameName.setValue(value);
getDs().save(entityWithSameName);
}