publicinterfaceObjectUpdater<L>{publicdefaultvoidinsertObjects(Set<L> objectSet,L... objects){for(L object: objects){if(!objectSet.contains(object)){
objectSet.add(object);}}}/**
* @method buildObjects
* @param attributes that the object have
* attributes[0] contains the first attribute of all the objects and so on
* @return an array of objects with the given attributes
* */publicL[]buildObjects(String[]... attributes);}
publicclassCourseUpdaterimplementsObjectUpdater<Course>{@OverridepublicCourse[]buildObjects(String[]... attributes){Course[] courses =newCourse[attributes[0].length];// the number of attributesfor(int i =0; i < attributes[0].length; i++){
courses[i]=newCourse(Integer.valueOf(attributes[0][i]), attributes[1][i],
attributes[2][i], attributes[3][i],Integer.valueOf(attributes[4][i]));}return courses;}}