MessagingTracing implements Closeable { public Builder toBuilder() { return new Builder(this); } MessagingTracing(Builder builder); static MessagingTracing create(Tracing tracing); static Builder newBuilder(Tracing tracing); Tracing tracing(); SamplerFunction<MessagingRequest> producerSampler(); SamplerFunction<MessagingRequest> consumerSampler(); Builder toBuilder(); @Nullable static MessagingTracing current(); @Override void close();  }
@Test public void toBuilder() { MessagingTracing messagingTracing = MessagingTracing.newBuilder(tracing).build(); assertThat(messagingTracing.toBuilder().build()) .usingRecursiveComparison() .isEqualTo(messagingTracing); assertThat(messagingTracing.toBuilder().producerSampler(neverSample()).build()) .usingRecursiveComparison() .isEqualTo(MessagingTracing.newBuilder(tracing).producerSampler(neverSample()).build()); }