return value.hashCode() * 31 + unit.hashCode();
} else if (name.equals("equals")) {
final Object obj = args[0];
if (!(obj instanceof AbstractQuantity))
return false;
<BUG>final AbstractQuantity<Q> that = (AbstractQuantity<Q>) obj;
if (!unit.isCompatible((AbstractUnit<?>) that.getUnit()))
return false;
return value.doubleValue() == (that).doubleValue(unit);</BUG>
} else if (name.equals("compareTo")) {

return value.hashCode() * 31 + unit.hashCode();
} else if (name.equals("equals")) {
final Object obj = args[0];
if (!(obj instanceof AbstractQuantity))
return false;
final AbstractQuantity<Q> that = (AbstractQuantity<Q>) obj;
return unit.isCompatible((AbstractUnit<?>) that.getUnit()) && value.doubleValue() == (that).doubleValue(unit);
} else if (name.equals("compareTo")) {
