3334353637383940414243
trainList.add(train); } @Override public void deleteTrainById(Long id) { Train foundTrain = findTrainById(id); if (foundTrain != null) { trainList.remove(foundTrain); id--; } }
4849505152535455565758
id = 0L; } @Override public void updateTrain(Train train) { Train foundTrain = findTrainById(train.getId()); if (foundTrain != null) { trainList.remove(foundTrain); trainList.add(train); } }