@VisibleForTesting
  boolean applyRaisingException() throws Exception {
    Boolean outcome = apply();
    if (thrown != null) {
      throw thrown;
    }
    return outcome;
  }
@Test
  public void testReadFailure() throws Throwable {
    int threshold = 50;
    SDKStreamDrainer drainer = new SDKStreamDrainer("s3://example/",
        new FakeSDKInputStream(BYTES, threshold),
        false,
        BYTES,
        EMPTY_INPUT_STREAM_STATISTICS, "test");
    intercept(IOException.class, "", () ->
        drainer.applyRaisingException());

    assertAborted(drainer);
  }