private static int countEquivalentLines(HashMap<Double, ArrayList<Line>> lines, Line line) {
        int cnt = 0;
        double key = floorToEps(line.slope);
        ArrayList<Line> linesOfSameKey = lines.get(key);
        if (linesOfSameKey != null) {
            for (Line l : linesOfSameKey) {
                if (line.equals(l)) ++cnt;
            }
        }
        linesOfSameKey = lines.get(key + EPSILON);
        if (linesOfSameKey != null) {
            for (Line l : linesOfSameKey) {
                if (line.equals(l)) ++cnt;
            }
        }
        linesOfSameKey = lines.get(key - EPSILON);
        if (linesOfSameKey != null) {
            for (Line l : linesOfSameKey) {
                if (line.equals(l)) ++cnt;
            }
        }
        return cnt;
    }