ConnectorStatus.Listener wrapStatusListener(ConnectorStatus.Listener delegateListener) {
        return new ConnectorStatusListener(delegateListener);
    }
@Test
    public void testConnectorFailureAfterStartupRecordedMetrics() {
        WorkerMetricsGroup workerMetricsGroup = new WorkerMetricsGroup(new HashMap<>(), new HashMap<>(), connectMetrics);
        final ConnectorStatus.Listener connectorListener = workerMetricsGroup.wrapStatusListener(delegateConnectorListener);

        connectorListener.onStartup(connector);
        connectorListener.onFailure(connector, exception);

        verify(delegateConnectorListener).onStartup(connector);
        verifyRecordConnectorStartupSuccess();
        verify(delegateConnectorListener).onFailure(connector, exception);
        // recordConnectorStartupFailure() should not be called if failure happens after a successful startup.
        verify(connectorStartupFailures, never()).record(anyDouble());
    }