vDoc = database.newInstance();
vDoc.setClassName("Profile");
vDoc.field("nick", "Jack").field("name", "Jack").field("surname", "Bauer");
vDoc.save();
OPropertyIndex indexName = database.getMetadata().getSchema().getClass("Profile").getProperty("name").getIndex();
// We must get 2 records for "nameA".
Collection<OIdentifiable> vName1 = indexName.getUnderlying().get("Jack");
Assert.assertEquals(vName1.size(), 2);
// Remove this last record.
database.delete(vDoc);
// We must get 1 record for "nameA".
vName1 = indexName.getUnderlying().get("Jack");
Assert.assertEquals(vName1.size(), 1);
database.close();
}