/**
  * Adds a series to the collection and sends a {@link DatasetChangeEvent} to all registered
  * listeners. The series should be configured to NOT allow duplicate x-values.
  *
  * @param series the series (<code>null</code> not permitted).
  */
 public void addSeries(XYSeries series) {
   if (series == null) {
     throw new IllegalArgumentException("Null 'series' argument.");
   }
   if (series.getAllowDuplicateXValues()) {
     throw new IllegalArgumentException(
         "Cannot accept XYSeries that allow duplicate values. "
             + "Use XYSeries(seriesName, <sort>, false) constructor.");
   }
   updateXPoints(series);
   this.data.add(series);
   series.addChangeListener(this);
   fireDatasetChanged();
 }