@Override
    public ControlledShutdownResponse getErrorResponse(int throttleTimeMs, Throwable e) {
        ControlledShutdownResponseData data = new ControlledShutdownResponseData()
                .setErrorCode(Errors.forException(e).code());
        return new ControlledShutdownResponse(data);
    }
@Test
    public void testGetErrorResponse() {
        for (short version : CONTROLLED_SHUTDOWN.allVersions()) {
            ControlledShutdownRequest.Builder builder = new ControlledShutdownRequest.Builder(
                    new ControlledShutdownRequestData().setBrokerId(1), version);
            ControlledShutdownRequest request = builder.build();
            ControlledShutdownResponse response = request.getErrorResponse(0,
                    new ClusterAuthorizationException("Not authorized"));
            assertEquals(Errors.CLUSTER_AUTHORIZATION_FAILED, response.error());
        }
    }