@Test
public void testIOError() {

  // Check true cases.
  Throwable ioError1 = new EOFException("io error 1");
  assertThat(errorExtractor.ioError(ioError1)).isTrue();
  assertThat(errorExtractor.ioError(new Exception(ioError1))).isTrue();
  assertThat(errorExtractor.ioError(new RuntimeException(new RuntimeException(ioError1))))
      .isTrue();
  Throwable ioError2 = new IOException("io error 2");
  assertThat(errorExtractor.ioError(ioError2)).isTrue();
  assertThat(errorExtractor.ioError(new Exception(ioError2))).isTrue();
  assertThat(errorExtractor.ioError(new RuntimeException(new RuntimeException(ioError2))))
      .isTrue();
  Throwable ioError3 = new IOError(new Exception("io error 3"));
  assertThat(errorExtractor.ioError(ioError3)).isTrue();
  assertThat(errorExtractor.ioError(new Exception(ioError3))).isTrue();
  assertThat(errorExtractor.ioError(new RuntimeException(new RuntimeException(ioError3))))
      .isTrue();
  // Check false cases.
  Throwable notIOError = new Exception("not io error");
  assertThat(errorExtractor.ioError(notIOError)).isFalse();
  assertThat(errorExtractor.ioError(new RuntimeException(notIOError))).isFalse();
}