int (ErrorStripe stripe) { if (stripe == this) return 0; if (stripe == null || stripe.myLayer < myLayer) return -1; if (stripe.myLayer > myLayer) return 1; int thisRGB = myColor.getRGB(); int thatRGB = stripe.myColor.getRGB(); if (thatRGB == thisRGB) return 0; return thatRGB < thisRGB ? -1 : 1; }