code: public Trace withSegments(Segment... segments) {
          if (this.segments == null) {
              setSegments(new java.util.ArrayList<Segment>(segments.length));
          }
          for (Segment ele : segments) {
              this.segments.add(ele);
          }
          return this;
      }
docs: <p>
  Segment documents for the segments and subsegments that comprise the trace.
  </p>
  <p>
  <b>NOTE:</b> This method appends the values to the existing list (if any). Use
  {@link #setSegments(java.util.Collection)} or {@link #withSegments(java.util.Collection)} if you want to override
  the existing values.
  </p>
  
  @param segments
  Segment documents for the segments and subsegments that comprise the trace.
  @return Returns a reference to this object so that method calls can be chained together.