@Override
  public Future<Long> write(ByteBuffer src, Callback<Long> callback) {
    if (exceptionToThrow instanceof RuntimeException) {
      throw (RuntimeException) exceptionToThrow;
    } else {
      return markFutureInvokeCallback(callback, 0, exceptionToThrow);
    }
  }
Creates an instance of BadAsyncWritableChannel that throws {@code exceptionToThrow} on write.
@param exceptionToThrow the {@link Exception} to throw on write.
ambry-commons/src/test/java/com/github/ambry/commons/ByteBufferReadableStreamChannelTest.java