class LineTagMap implements Serializable {

        private static final long serialVersionUID = 1191703801007779481L;
        @SuppressWarnings("java:S116")
        private final Map<String, Set<Tag>> sym_tags; //NOPMD

        protected LineTagMap() {
            this.sym_tags = new HashMap<>();
        }
    }
    // line number -> tag map
    @SuppressWarnings("java:S116")
    private final Map<Integer, LineTagMap> line_maps;

    /**
     * Map from symbol to the line numbers on which the symbol is defined.
     */
    private final Map<String, Set<Integer>> symbols;
    /**
     * List of all the tags.
     */
    private final List<Tag> tags;

    public Definitions() {
        symbols = new HashMap<>();
        line_maps = new HashMap<>();
        tags = new ArrayList<>();
    }

    /**
     * Reset all {@link Tag#used} values to {@code false}.
     */
    public void resetUnused() {
        for (Tag tag : tags) {
            tag.used = false;
        }
    }

    /**
     * Get all symbols used in definitions.
     *
     * @return a set containing all the symbols
     */
    public Set<String> getSymbols() {
        return symbols.keySet();
    }

    /**
     * Check if there is a tag for a symbol.
     *
     * @param symbol the symbol to check
     * @return {@code true} if there is a tag for {@code symbol}
     */
    public boolean hasSymbol(String symbol) {
        return symbols.containsKey(symbol);
    }

    /**
     * Check whether the specified symbol is defined on the given line.
     *
     * @param symbol the symbol to look for
     * @param lineNumber the line to check
     * @param strs type of definition(to be passed back to caller)
     * @return {@code true} if {@code symbol} is defined on the specified line
     */
    public boolean hasDefinitionAt(String symbol, int lineNumber, String[] strs) {
        if (strs.length > 0) {
            strs[0] = "none";
        }

        // Get tag info
        boolean isDefinitionPresent = Optional.ofNullable(symbols.get(symbol))
                .filter(lines -> lines.contains(lineNumber))
                .isPresent();
        if (isDefinitionPresent) {
            LineTagMap lineMap = line_maps.get(lineNumber);
            if (lineMap != null) {
                for (Tag tag : lineMap.sym_tags.get(symbol)) {
                    if (tag.used) {
                        continue;
                    }
                    if (strs.length > 0) { //NOPMD
                        strs[0] = tag.type;
                    }
                    tag.used = true;
                    // Assume the first one
                    return true;
                }
            }
        }
        return false;
    }

    /**
     * Return the number of occurrences of definitions with the specified
     * symbol.
     *
     * @param symbol the symbol to count the occurrences of
     * @return the number of times the specified symbol is defined
     */
    public int occurrences(String symbol) {<FILL_FUNCTION_BODY>

        Set<Integer> lines = symbols.get(symbol);
        return lines == null ? 0 : lines.size();
    
<no_super_class>