1 public class Size
implements Comparable
<Size
> {
13 public int getSize() {
17 public void setSize(int size
) {
18 if (validateSize(size
)) {
21 throw new IllegalArgumentException("Size must be between " + this.min
+ " and " + this.max
);
25 private boolean validateSize(int size
) {
26 return (size
>= min
&& size
<= max
);
30 public int compareTo(Size size
) {
31 int distance
= size
.getSize() - this.getSize();