code: public static DataSet copyOf(DataSet data) {
      if (data == null) {
        throw new InvalidOperationException("Null data set");
      }
      DataSet r = new DataSet(data.getSource());
      r.getRows().addAll(data.getRows());
      return r;
    }
docs: Create data set with the same contents of given data set.
  @param data Source data set.
  @return A new data set containing all
  rows in the source data set.
  @throws InvalidOperationException if given data set is null.