public void doUnsupportedVoidFunctionDelegationCheck() {
        if (mockConsumer == null || wrapperConsumer == null) {
            throwExceptionForIllegalTestSetup();
        }

        // configure the mock to behave as desired
        mockConsumer.accept(Mockito.doCallRealMethod().when(mock));

        assertThrows(UnsupportedOperationException.class, () -> wrapperConsumer.accept(wrapper),
            "Expected to Throw UnsupportedOperationException");
    }
@param wrapper the wrapper
@return the underlying delegate for the given wrapper
server-common/src/test/java/org/apache/kafka/server/immutable/DelegationChecker.java