docs: public static ImmutableSet<VarSymbol> findUnusedIdentifiers(VisitorState state) {
      ImmutableSet.Builder<VarSymbol> definedVariables = ImmutableSet.builder();
      ImmutableSet.Builder<Symbol> usedSymbols = ImmutableSet.builder();
      Tree prev = state.getPath().getLeaf();
      for (Tree curr : state.getPath().getParentPath()) {
        createFindIdentifiersScanner(usedSymbols, prev).scan(curr, null);
        switch (curr.getKind()) {
          case BLOCK:
            // If we see a block then walk over each statement to see if it defines a variable
            for (StatementTree statement : ((BlockTree) curr).getStatements()) {
              if (statement.equals(prev)) {
                // break if we see the tree we have just processed so that we only consider things
                // declared/used before us in the tree
                break;
              }
              addIfVariable(statement, definedVariables);
            }
            break;
          case FOR_LOOP:
            ForLoopTree forLoop = (ForLoopTree) curr;
            forLoop.getInitializer().stream().forEach(t -> addIfVariable(t, definedVariables));
            break;
          case ENHANCED_FOR_LOOP:
            EnhancedForLoopTree enhancedFor = (EnhancedForLoopTree) curr;
            addIfVariable(enhancedFor.getVariable(), definedVariables);
            break;
          default:
            break;
        }
        prev = curr;
      }
      return ImmutableSet.copyOf(Sets.difference(definedVariables.build(), usedSymbols.build()));
    }