code: public static final Segment encode(final SegmentId segment) {
          Preconditions.checkNotNull(segment, "segment");
          return new Segment(segment.getStreamInfo().getScope(),
                  segment.getStreamInfo().getStream(),
                  segment.getSegmentId());
      }
docs: Helper to convert Segment Id into Segment object.
  
  @param segment The Segment Id.
  @return New instance of Segment.