I am having a problem devising an algorithm for a specific task.
Say there is a map - Map<Object, Set<String>>
. Each key represents a definition of specific car components.
Lets map has these values:
wheels=["18", "16", "17", "19"...]; bodyColor=["Green", "White", "Blue",...]; doorCount=["2", "3", "4", "5"]; horsePower=["100", "130", "145", "160"...]; fuelType=["gas", "electric", "diesel", "fuel"]; ...etc (key value pairs keep going)
All these sets are finite of-course. Problem: Lets assume we have this POJO:
public class CarProfile {
private String wheels;
private String bodyColor;
private String doorCount;
private String horse Power;
private Set<String> fuelTypes;
//String, Sets, Lists keep going
}
Lets assume that system receives populated List<CarProfile>
and needs to check that all possible variants are covered in relation to map. Notice that some fields can contain single value while others can contain sets or lists of them. I am struggling to find an appropriate solution. Is there any generic algorithm for similar problems I am unable to find ?
Thank you.