public boolean equals(Object obj) {
		if (obj == this) {
			return true;
		}
		if (!(obj instanceof SlidingCategoryDataset)) {
			return false;
		}
		SlidingCategoryDataset that = (SlidingCategoryDataset) obj;
		if (this.firstCategoryIndex != that.firstCategoryIndex) {
			return false;
		}
		if (this.maximumCategoryCount != that.maximumCategoryCount) {
			return false;
		}
		if (!this.underlying.equals(that.underlying)) {
			return false;
		}
		return true;
	}

    /**
     * Returns an independent copy of the dataset.  Note that:
     * <ul>
     * <li>the underlying dataset is only cloned if it implements the
     * {@link PublicCloneable} interface;</li>
     * <li>the listeners registered with this dataset are not carried over to
     * the cloned dataset.</li>
     * </ul>
     *
     * @return An independent copy of the dataset.
     *
     * @throws CloneNotSupportedException if the dataset cannot be cloned for
     *         any reason.
     */
    public Object clone() throws CloneNotSupportedException {
        SlidingCategoryDataset clone = (SlidingCategoryDataset) super.clone();
        if (this.underlying instanceof PublicCloneable) {
        	PublicCloneable pc = (PublicCloneable) this.underlying;
            clone.underlying = (CategoryDataset) pc.clone();
        }
        return clone;