docs: public CacheEntry<Q, Set<ConceptMap>> record(Q query, ConceptMap answer, @Nullable CacheEntry<Q, Set<ConceptMap>> entry, @Nullable MultiUnifier unifier) {
          CacheEntry<Q, Set<ConceptMap>> match = entry != null ? entry : this.getEntry(query);
          if (match != null) {
              Q equivalentQuery = match.query();
              Set<ConceptMap> answers = match.cachedElement();
              MultiUnifier multiUnifier = unifier == null ? query.getMultiUnifier(equivalentQuery, unifierType()) : unifier;
  
              Set<Variable> cacheVars = answers.isEmpty() ? new HashSet<>() : answers.iterator().next().vars();
              multiUnifier
                      .apply(answer)
                      .peek(ans -> {
                          if (!ans.vars().containsAll(cacheVars)) {
                              throw GraqlQueryException.invalidQueryCacheEntry(equivalentQuery, ans);
                          }
                      })
                      .forEach(answers::add);
              return match;
          } else {
              if (!answer.vars().containsAll(query.getVarNames())) {
                  throw GraqlQueryException.invalidQueryCacheEntry(query, answer);
              }
              return putEntry(query, Sets.newHashSet(answer));
          }
      }