boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Segment segment = (Segment)o; if (end != segment.end) return false; if (start != segment.start) return false; if (color != null ? !color.equals(segment.color) : segment.color != null) return false; return true; }