I tested my code:
Set<Solution> s = new HashSet<>();
       Date d = new Date();
       Solution a = new Solution();
       Solution sol = new Solution(3, "ala", 2.2, d, a);
       System.out.println(s.add(sol));
       System.out.println(s.add(sol));
output is: true false