@Override
  public void setQualityGate(QualityGate g) {
    // fail fast
    requireNonNull(g);
    checkState(qualityGate == null, "QualityGateHolder can be initialized only once");

    this.qualityGate = g;
  }
@Test
  public void setQualityGate_throws_ISE_if_called_twice() {
    assertThatThrownBy(() -> {
      QualityGateHolderImpl holder = new QualityGateHolderImpl();

      holder.setQualityGate(QUALITY_GATE);
      holder.setQualityGate(QUALITY_GATE);
    })
      .isInstanceOf(IllegalStateException.class);
  }