@Override
        public boolean equals(Object o) {
            if (!(o instanceof Line)) return false;
            Line that = (Line) o;
            if (vertical) {
                return that.vertical &&
                       isEquivalent(x, that.x);
            } else {
                return isEquivalent(slope, that.slope) &&
                       isEquivalent(intercept, that.intercept);
            }
        }