}
@Test
public void canOnlyInsertOnceAPojoWithACustomId() throws Exception {
collection.withWriteConcern(WriteConcern.SAFE).insert(new ExternalFriend(122, "value"));
try {
collection.withWriteConcern(WriteConcern.SAFE).insert(new ExternalFriend(122, "other value"));
Assert.fail();
} catch (MongoException.DuplicateKey e) {
}
}