|Added at||2016-12-31 09:12|
Let's say I have this client-side JSON input:
I have this class:
I have this Java Spring endpoint where I pass the input in the body of a POST request:
I would like in:
to have only two entries in the correct order... since one of them is a duplicate based on the id... Instead I get duplicates in the LinkedHashSet (!)
I thought from the code I have that removing duplicates would work automatically, but apparently it is not.
This question has a broader context than Why do I need to override the equals and hashCode methods in Java? since it is using implicit Jackson serialization through Java Spring.