I have a set, i.e
Set<FitmentData> fitmentDataSet;
this set has around 5 objects.
public class FitmentData implements Comparable<FitmentData>
{
private String year;
private String make;
private String model;
}
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?
Note: My sample fitment object looks like
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" );