protected abstract void close();
@Test
    public void testCloseClosesManagedResourcesIfSubclassThrows() {
        ConnectorTaskId taskId = new ConnectorTaskId("foo", 0);

        WorkerTask<Object, SourceRecord> workerTask = new TestWorkerTask(taskId, statusListener, TargetState.STARTED, loader, metrics, errorHandlingMetrics,
                retryWithToleranceOperator, transformationChain, errorReportersSupplier, Time.SYSTEM, statusBackingStore) {
            @Override
            protected void close() {
                throw new ConnectException("Failure during close");
            }
        };

        assertThrows(ConnectException.class, workerTask::doClose);

        verify(retryWithToleranceOperator).close();
        verify(transformationChain).close();
    }