final MyEntity entity = new MyEntity(1L, new ValueObject(2L));
final DBObject dbObject = getMorphia().toDBObject(entity);
final byte[] data = new DefaultDBEncoder().encode(dbObject);
final DBObject decoded = new DefaultDBDecoder().decode(data, (DBCollection) null);
final MyEntity actual = getMorphia().fromDBObject(MyEntity.class, decoded);
assertEquals(entity, actual);
}