Need to loop through set to find different objects by attributes
<p>I have a  set, i.e </p>

<pre><code>Set&lt;FitmentData&gt; fitmentDataSet;
</code></pre>

<p>this set has around 5 objects. </p>

<pre><code>public class FitmentData implements Comparable&lt;FitmentData&gt; 
{
private String year;
private String make;
private String model;

}
</code></pre>

<p>Now, I need to iterate through this set and find out how many different vehicles this set has comparing year,make and model.I was thinking to get the first object and loop through set by comparing year, make, model. Is there a better way to deal this?</p>

<p>Note: My sample fitment object looks like</p>

<pre><code>new FitementDate("2005", "honda","crv" );
new FitementDate("2005", "honda","crv" );
new FitementDate("2005", "honda","crv" );
new FitementDate("2005", "mazda","cx-5" );
new FitementDate("2005", "subaru","forester" );
</code></pre>