25.19 Line with Most Points

  1. The Rational class seems to be missing an equals() method definition, which is being used in the equals method of Line.

  2. I don’t understand this code:
    Set s1 = table.get(l);
    if (s1 == null) {
    s1 = new HashSet<>();
    table.put(l, s1);

     Set<Point> s2 = table.get(l);
     if (s2 == null) {
       s2 = new HashSet<>();
       table.put(l, s2);


Why are two sets getting created? Don’t we just need one and add both points to it?