docs: public static List<String> genNoncollidingBaseNamesForExprs(
        List<ExprNode> exprNodes, String fallbackBaseName, ErrorReporter errorReporter) {
  
      int numExprs = exprNodes.size();
  
      // --- Compute candidate base names for each expression. ---
      List<List<String>> candidateBaseNameLists = Lists.newArrayListWithCapacity(numExprs);
      for (ExprNode exprRoot : exprNodes) {
        candidateBaseNameLists.add(genCandidateBaseNamesForExpr(exprRoot));
      }
  
      // --- Build a multiset of collision strings (if key has > 1 values, then it's a collision). ---
      // Note: We could combine this loop with the previous loop, but it's more readable this way.
      Multimap<String, ExprNode> collisionStrToLongestCandidatesMultimap = HashMultimap.create();
      for (int i = 0; i < numExprs; i++) {
        ExprNode exprRoot = exprNodes.get(i);
        List<String> candidateBaseNameList = candidateBaseNameLists.get(i);
        if (candidateBaseNameList.isEmpty()) {
          continue;
        }
        String longestCandidate = candidateBaseNameList.get(candidateBaseNameList.size() - 1);
        // Add longest candidate as a collision string.
        collisionStrToLongestCandidatesMultimap.put(longestCandidate, exprRoot);
        // Add all suffixes that begin after an underscore char as collision strings.
        for (int j = 0, n = longestCandidate.length(); j < n; j++) {
          if (longestCandidate.charAt(j) == '_') {
            collisionStrToLongestCandidatesMultimap.put(longestCandidate.substring(j + 1), exprRoot);
          }
        }
      }
  
      // --- Find the shortest noncolliding candidate base name for each expression. ---
      List<String> noncollidingBaseNames = Lists.newArrayListWithCapacity(numExprs);
  
      OUTER:
      for (int i = 0; i < numExprs; i++) {
        List<String> candidateBaseNameList = candidateBaseNameLists.get(i);
  
        if (!candidateBaseNameList.isEmpty()) {
          // Has candidates: Use the shortest candidate that doesn't collide.
  
          for (String candidateBaseName : candidateBaseNameList) {
            if (collisionStrToLongestCandidatesMultimap.get(candidateBaseName).size() == 1) {
              // Found candidate with 1 value in multimap, which means no collision.
              noncollidingBaseNames.add(candidateBaseName);
              continue OUTER;
            }
          }
  
          // Did not find any candidate with no collision.
          ExprNode exprRoot = exprNodes.get(i);
          String longestCandidate = candidateBaseNameList.get(candidateBaseNameList.size() - 1);
          ExprNode collidingExprRoot = null;
          for (ExprNode er : collisionStrToLongestCandidatesMultimap.get(longestCandidate)) {
            if (er != exprRoot) {
              collidingExprRoot = er;
              break;
            }
          }
          errorReporter.report(
              collidingExprRoot.getSourceLocation(),
              COLLIDING_EXPRESSIONS,
              exprRoot.toSourceString(),
              collidingExprRoot.toSourceString());
          return noncollidingBaseNames;
        } else {
          // No candidates: Use fallback.
          noncollidingBaseNames.add(fallbackBaseName);
        }
      }
  
      return noncollidingBaseNames;
    }