@Test
void references() {

    String name = this.connector.getHelperManager().getCollectionHelper().getCollection(Topic.class);
    MongoCollection<Document> collection = this.connector.getDatabase().getCollection(name);
    collection.deleteMany(new BsonDocument());
    assertEquals(0, collection.count());
    name = this.connector.getHelperManager().getCollectionHelper().getCollection(Index.class);
    collection = this.connector.getDatabase().getCollection(name);
    collection.deleteMany(new BsonDocument());
    assertEquals(0, collection.count());
    Topic topic = new Topic("test");
    Index index = new Index(topic);
    topic.save();
    index.save();
    connector.getEntityManager().getCache().getIds().clear();
    connector.getEntityManager().getCache().getCache().clear();
    index = connector.createQuery(Index.class).result().first();
    assertEquals("test", index.topic.name);
}