@Override
  public MetricResults metrics() {
    if (terminalMetrics != null) {
      return terminalMetrics;
    }
    return delegate.metrics();
  }
@Test
  public void givenNotTerminated_reportsMetrics() {
    PipelineResult delegate = mock(PipelineResult.class);
    when(delegate.metrics()).thenReturn(mock(MetricResults.class));
    PrismPipelineResult underTest = new PrismPipelineResult(delegate, exec::stop);
    assertThat(underTest.metrics()).isNotNull();
    exec.stop();
  }