class PluginDependency {

    private String pluginId;
    private String pluginVersionSupport = "*";
    private final boolean optional;

    public PluginDependency(String dependency) {
        int index = dependency.indexOf('@');
        if (index == -1) {
            this.pluginId = dependency;
        } else {
            this.pluginId = dependency.substring(0, index);
            if (dependency.length() > index + 1) {
                this.pluginVersionSupport = dependency.substring(index + 1);
            }
        }

        // A dependency is considered as optional, if the plugin id ends with a question mark.
        this.optional = this.pluginId.endsWith("?");
        if (this.optional) {
            this.pluginId = this.pluginId.substring(0, this.pluginId.length() - 1);
        }
    }

    /**
     * Returns the unique identifier of the plugin.
     *
     * @return the plugin id
     */
    public String getPluginId() {
        return pluginId;
    }

    /**
     * Returns the version of the plugin that is required.
     *
     * @return the version of the plugin that is required
     */
    public String getPluginVersionSupport() {
        return pluginVersionSupport;
    }

    /**
     * Returns {@code true} if the dependency is optional, {@code false} otherwise.
     *
     * @return {@code true} if the dependency is optional, {@code false} otherwise
     */
    public boolean isOptional() {
        return optional;
    }

    @Override
    public String toString() {
        return "PluginDependency [pluginId=" + pluginId + ", pluginVersionSupport="
            + pluginVersionSupport + ", optional="
            + optional + "]";
    }

    @Override
    public boolean equals(Object o) {<FILL_FUNCTION_BODY>}

    @Override
    public int hashCode() {
        return Objects.hash(pluginId, pluginVersionSupport, optional);
    }

}

        if (this == o) return true;
        if (!(o instanceof PluginDependency)) return false;
        PluginDependency that = (PluginDependency) o;
        return optional == that.optional &&
            pluginId.equals(that.pluginId) &&
            pluginVersionSupport.equals(that.pluginVersionSupport);
    
<no_super_class>