public AnalysisPropertyDto setKey(String key) {
    requireNonNull(key, "key cannot be null");
    this.key = key;
    return this;
  }
@Test
  void null_key_should_throw_NPE() {
    underTest = new AnalysisPropertyDto();

    assertThatThrownBy(() -> underTest.setKey(null))
      .isInstanceOf(NullPointerException.class)
      .hasMessage("key cannot be null");
  }