### Question:
ExerciseList extends EntryList<Exercise> { public void updateSportTypes(SportTypeList sportTypeList) { this.forEach(exercise -> { SportType newSportType = sportTypeList.getByID(exercise.getSportType().getId()); exercise.setSportType(newSportType); SportSubType newSportSubType = newSportType.getSportSubTypeList().getByID(exercise.getSportSubType().getId()); exercise.setSportSubType(newSportSubType); if (exercise.getEquipment() != null) { Equipment newEquipment = newSportType.getEquipmentList().getByID(exercise.getEquipment().getId()); exercise.setEquipment(newEquipment); } }); }  void updateSportTypes(SportTypeList sportTypeList);  }### Answer:
@Test public void testUpdateSportTypes() { Exercise exercise3 = list.getByID(3); assertEquals(3, exercise3.getId()); assertEquals("SportType 2", exercise3.getSportType().getName()); assertEquals("SportSubType 22", exercise3.getSportSubType().getName()); SportType sportType2 = sportTypeList.getByID(2); SportSubType sportSubType22 = sportType2.getSportSubTypeList().getByID(22); assertNotNull(sportType2); assertNotNull(sportSubType22); SportSubType sportSubType22New = (SportSubType) sportSubType22.clone(); sportSubType22New.setName("SportSubType 22 - New"); sportType2.getSportSubTypeList().set(sportSubType22New); assertEquals("SportSubType 22", exercise3.getSportSubType().getName()); list.updateSportTypes(sportTypeList); assertEquals("SportSubType 22 - New", exercise3.getSportSubType().getName()); SportType sportType2New = (SportType) sportType2.clone(); sportType2New.setName("SportType 2 - New"); sportTypeList.set(sportType2New); assertEquals("SportType 2", exercise3.getSportType().getName()); list.updateSportTypes(sportTypeList); assertEquals("SportType 2 - New", exercise3.getSportType().getName()); Equipment equipment22Old = sportTypeList.getByID(2).getEquipmentList().getByID(22); assertEquals("Equipment 22", equipment22Old.getName()); Equipment equipment22New = (Equipment) equipment22Old.clone(); equipment22New.setName("Equipment 22 - New"); sportTypeList.getByID(2).getEquipmentList().set(equipment22New); assertEquals("Equipment 22", exercise3.getEquipment().getName()); list.updateSportTypes(sportTypeList); assertEquals("Equipment 22 - New", exercise3.getEquipment().getName()); }