class AbstractVariableDescriptorBasedDemand<Solution_, Supply_ extends Supply>
        implements Demand<Supply_> {

    protected final VariableDescriptor<Solution_> variableDescriptor;

    protected AbstractVariableDescriptorBasedDemand(VariableDescriptor<Solution_> variableDescriptor) {
        this.variableDescriptor = Objects.requireNonNull(variableDescriptor);
    }

    @Override
    public final boolean equals(Object other) {
        if (this == other)
            return true;
        if (other == null || getClass() != other.getClass())
            return false;
        AbstractVariableDescriptorBasedDemand<?, ?> that = (AbstractVariableDescriptorBasedDemand<?, ?>) other;
        return Objects.equals(variableDescriptor, that.variableDescriptor);
    }

    @Override
    public final int hashCode() {<FILL_FUNCTION_BODY>}

    @Override
    public final String toString() {
        return getClass().getSimpleName() + "(" + variableDescriptor.getSimpleEntityAndVariableName() + ")";
    }

}
 // Don't use Objects.hashCode(...) as that would create varargs array on the hot path.
        int result = this.getClass().getName().hashCode();
        result = 31 * result + variableDescriptor.hashCode();
        return result;
    
<no_super_class>