class RustUtils {

    /**
     * Private to enforce singleton.
     */
    private  RustUtils() {
    }

    /**
     * Counts the number of hashes ('#') before a terminating quote ('"') in
     * {@code capture}.
     * @param capture the Rust raw- or raw-byte-string initiator (e.g.,
     * {@code "r##\""})
     * @return the number of hashes counted
     */
    public static int countRawHashes(String capture) {<FILL_FUNCTION_BODY>}

    /**
     * Determines if the specified {@code capture} starts with a quote ('"')
     * and is followed by the specified number of hashes (plus possibly an
     * excess number of hashes), indicating the end of a raw- or raw-byte-
     * string.
     * @param capture the possible Rust raw- or raw-byte-string ender (e.g.,
     * {@code "\"####"})
     * @param rawHashCount the number of required hashes in order to be
     * considered "raw-ending"
     * @return true if the {@code capture} is determined to be "raw-ending" or
     * false otherwise (N.b., there may have been too many hashes captured, so
     * any excess of {@code yylength()} minus one minus {@code rawHashCount}
     * should be pushed back.
     */
    public static boolean isRawEnding(String capture, int rawHashCount) {
        if (!capture.startsWith("\"")) {
            throw new IllegalArgumentException(
                "`capture' does not start with \"");
        }

        int n = 0;
        for (int i = 1; i < capture.length(); ++i) {
            if (capture.charAt(i) != '#') {
                break;
            }
            ++n;
            if (n >= rawHashCount) {
                break;
            }
        }
        return n >= rawHashCount;
    }
}

        if (!capture.endsWith("\"")) {
            throw new IllegalArgumentException("`capture' does not end in \"");
        }

        int n = 0;
        for (int i = capture.length() - 2; i >= 0; --i) {
            if (capture.charAt(i) != '#') {
                break;
            }
            ++n;
        }
        return n;
    
<no_super_class>