title: How to remove duplicates from a list based on a custom java object not a primitive type?
body: <p>Before I post this question, I found somehow similar question posted <a href="https://stackoverflow.com/questions/203984/how-do-i-remove-repeated-elements-from-arraylist">here</a>. But the answer was based on a String. However, I have a different situation here. I am not trying to remove String but another object called AwardYearSource. This class has an int attribute called year. So I want to remove duplicates based on the year. i.e if there is year 2010 mentioned more than once, I want to remove that AwardYearSource object. How can I do that? </p>