public IssueDto addImpact(ImpactDto impact) {
    impacts.stream().filter(impactDto -> impactDto.getSoftwareQuality() == impact.getSoftwareQuality()).findFirst()
      .ifPresent(impactDto -> {
        throw new IllegalStateException(format("Impact already defined on issue for Software Quality [%s]", impact.getSoftwareQuality()));
      });

    impacts.add(impact);
    return this;
  }
@Test
  void addImpact_whenSoftwareQualityAlreadyDefined_shouldThrowISE() {
    IssueDto dto = new IssueDto();
    dto.addImpact(newImpactDto(MAINTAINABILITY, LOW));

    ImpactDto duplicatedImpact = newImpactDto(MAINTAINABILITY, HIGH);

    assertThatThrownBy(() -> dto.addImpact(duplicatedImpact))
      .isInstanceOf(IllegalStateException.class)
      .hasMessage("Impact already defined on issue for Software Quality [MAINTAINABILITY]");
  }