47547ba4f524711c42a3bc1c3e561fec0be48853
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
.weight
- this.getWeight();