IdentifyMessage implements Message { public static Builder builder() { return new Builder(); }  static Builder builder(); @Nullable abstract Map<String, ?> traits(); Builder toBuilder();  }
@Test public void userIdOrTraitsAreRequired() { try { IdentifyMessage.builder().userId("userId").build(); } catch (IllegalStateException e) { assertThat(e).hasMessage("Either userId or traits must be provided."); } }