1 public class Size
implements Comparable
<Size
> {
21 public int getSize() {
25 public void setSize(int size
) {
26 if (validateSize(size
)) {
29 throw new IllegalArgumentException("Size must be between " + this.getMin() + " and " + this.getMax());
33 private boolean validateSize(int size
) {
34 return (size
>= getMin() && size
<= getMax());
38 public int compareTo(Size size
) {
39 int distance
= size
.getSize() - this.getSize();