But the condition 4: The equals method must return true if the first and last fields are equal to the passed object and the current one (don't forget that they might be null)., fails.
public boolean equals(Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof Solution)) {
            return false;
        }
        Solution s = (Solution) o;
        return first.equals(s.first) && last.equals(s.last);
    }