class LeaderAndIsrResponse extends AbstractResponse {

    @Override
    public Map<Errors, Integer> errorCounts() {
        Errors error = error();
        if (error != Errors.NONE)
            // Minor optimization since the top-level error applies to all partitions
            return Collections.singletonMap(error, data.partitionErrors().size());
        return errorCounts(data.partitionErrors().stream().map(l -> Errors.forCode(l.errorCode())));
    }

    public  LeaderAndIsrResponse(LeaderAndIsrResponseData data);
    public  LeaderAndIsrResponse(Struct struct, short version);

}