@Test
    public void testShouldThrottle() {
        for (short version : ApiKeys.OFFSET_FETCH.allVersions()) {
            if (version < 8) {
                OffsetFetchResponse response = new OffsetFetchResponse(throttleTimeMs, Errors.NONE, partitionDataMap);
                if (version >= 4) {
                    assertTrue(response.shouldClientThrottle(version));
                } else {
                    assertFalse(response.shouldClientThrottle(version));
                }
            } else {
                OffsetFetchResponse response = new OffsetFetchResponse(
                    throttleTimeMs,
                    Collections.singletonMap(groupOne, Errors.NOT_COORDINATOR),
                    Collections.singletonMap(groupOne, partitionDataMap));
                assertTrue(response.shouldClientThrottle(version));
            }
        }
    }
Test behavior changes over the versions. Refer to resources.common.messages.OffsetFetchResponse.json
clients/src/test/java/org/apache/kafka/common/requests/OffsetFetchResponseTest.java