@Test
public void testRateLimited() {

  // Check success case.
  assertThat(errorExtractor.rateLimited(rateLimited)).isTrue();
  assertThat(errorExtractor.rateLimited(new IOException(rateLimited))).isTrue();
  assertThat(errorExtractor.rateLimited(new IOException(new IOException(rateLimited)))).isTrue();
  // Check failure cases.
  assertThat(errorExtractor.rateLimited(notRateLimited)).isFalse();
  assertThat(errorExtractor.rateLimited(new IOException(notRateLimited))).isFalse();
  assertThat(errorExtractor.rateLimited(new IOException(statusOk))).isFalse();
  assertThat(errorExtractor.rateLimited(null)).isFalse();
}