IdentifyMessage implements Message { public Builder toBuilder() { return new Builder(this); }  static Builder builder(); @Nullable abstract Map<String, ?> traits(); Builder toBuilder();  }
@Test public void toBuilder() { IdentifyMessage original = IdentifyMessage.builder().traits(ImmutableMap.of("foo", "bar")).userId("userId").build(); IdentifyMessage copy = original.toBuilder().build(); assertThat(copy.userId()).isEqualTo("userId"); assertThat(copy.traits()).isEqualTo(ImmutableMap.of("foo", "bar")); }