code: public DatastreamVersion addVersion(Date createdDate) {
          int n = versions.size();
          while (hasVersion(id + "." + n)) {
              n++;
          }
          DatastreamVersion dsv = new DatastreamVersion(id + "." + n,
                  createdDate);
          versions.add(dsv);
          return dsv;
      }
docs: Creates and adds a new datastream version with an automatically
  generated id that is unique within the existing versions. The id
  will start with <code>this.id() + "."</code> and have a numeric suffix.
  
  @param createdDate the created date to use for the new datastream
  version, possibly <code>null</code>.
  @return the new version.