public void setWeight(int weight) {
if (validateWeight(weight)) {
this.weight = weight;
- } /* FIXME: raise an error */
+ } else {
+ throw new IllegalArgumentException("Weight cannot be negative or zero");
+ }
}
private boolean validateWeight(int weight) {