private static Segment TryGetLastFinishedSegment(ImmutableTransaction transaction)
 {
     return(transaction.Segments
            .Where(segment => segment.RelativeEndTime != null)
            .OrderByDescending(segment => segment.RelativeEndTime)
            .FirstOrDefault());
 }
 private static Segment TryGetLastStartedSegment(ImmutableTransaction transaction)
 {
     return(transaction.Segments.LastOrDefault());
 }