The attributes from the input csv file is converted to a Rule object stored in a Set which is used so time is not wasted in putting duplicate entries in the data structure.
I have used Set as inserting and searching in a Set is O(1).
Also, I have overloaded the equals() method of Object class for comparing attributes of Rule object.
private is used to restrict write access to Rule objects and final is used so the variables are not be modified.
Unit testing is done using JUnit testing framework.
As per the problem statement, it is assumed that the input csv file will be well formed.
All the edge cases are handled properly by the code.
- Data team
- Platform team
- Policy team