@Override
  public State getState() {
    if (terminalState != null) {
      return terminalState;
    }
    return delegate.getState();
  }
@Test
  public void givenNotTerminated_reportsState() {
    PipelineResult delegate = mock(PipelineResult.class);
    when(delegate.getState()).thenReturn(PipelineResult.State.RUNNING);
    PrismPipelineResult underTest = new PrismPipelineResult(delegate, exec::stop);
    assertThat(underTest.getState()).isEqualTo(PipelineResult.State.RUNNING);
    exec.stop();
  }