ConfigurationChangedDTO implements EventDTO { static ConfigurationChangedDTO from(ConfigurationChanged configurationChanged, String type) { Preconditions.checkNotNull(configurationChanged); CassandraMailQueueViewConfiguration configuration = configurationChanged.getConfiguration(); return new ConfigurationChangedDTO( configurationChanged.eventId().serialize(), configurationChanged.getAggregateId().asAggregateKey(), type, configuration.getBucketCount(), configuration.getUpdateBrowseStartPace(), configuration.getSliceWindow()); } @JsonCreator  ConfigurationChangedDTO(
        @JsonProperty("eventId") int eventId,
        @JsonProperty("aggregateKey") String aggregateKey,
        @JsonProperty("type") String type,
        @JsonProperty("bucketCount") int bucketCount,
        @JsonProperty("updateBrowseStartPace") int updateBrowseStartPace,
        @JsonProperty("sliceWindow") Duration sliceWindow); @JsonIgnore ConfigurationChanged toEvent(); int getEventId(); String getAggregateKey(); String getType(); int getBucketCount(); int getUpdateBrowseStartPace(); Duration getSliceWindow(); @Override final boolean equals(Object o); @Override final int hashCode();  }
@Test void fromShouldThrowWhenConfigurationAddedIsNull() { assertThatThrownBy(() -> ConfigurationChangedDTO.from(null)) .isInstanceOf(NullPointerException.class); }