5e33327fac7ec77eac23a14ec0aa46a6b4e65342
1 public class Weight
implements Comparable
<Weight
> {
11 public int getWeight() {
15 public void setWeight(int weight
) {
16 if (validateWeight(weight
)) {
19 throw new IllegalArgumentException("Weight cannot be negative or zero");
23 private boolean validateWeight(int weight
) {
28 public int compareTo(Weight weight
) {
29 int distance
= weight
.getWeight() - this.getWeight();