private List<Future<?>> queueAllBlockingOperations(
      final FileChannel channel, ExecutorService executor, final CountDownLatch startLatch) {
    List<Future<?>> futures = new ArrayList<>();

    final ByteBuffer buffer = ByteBuffer.allocate(10);
    futures.add(
        executor.submit(
            new Callable<Object>() {
              @Override
              public Object call() throws Exception {
                startLatch.countDown();
                channel.write(buffer);
                return null;
              }
            }));

    futures.add(
        executor.submit(
            new Callable<Object>() {
              @Override
              public Object call() throws Exception {
                startLatch.countDown();
                channel.write(buffer, 0);
                return null;
              }
            }));

    futures.add(
        executor.submit(
            new Callable<Object>() {
              @Override
              public Object call() throws Exception {
                startLatch.countDown();
                channel.write(new ByteBuffer[] {buffer, buffer});
                return null;
              }
            }));

    futures.add(
        executor.submit(
            new Callable<Object>() {
              @Override
              public Object call() throws Exception {
                startLatch.countDown();
                channel.write(new ByteBuffer[] {buffer, buffer, buffer}, 0, 2);
                return null;
              }
            }));

    futures.add(
        executor.submit(
            new Callable<Object>() {
              @Override
              public Object call() throws Exception {
                startLatch.countDown();
                channel.read(buffer);
                return null;
              }
            }));

    futures.add(
        executor.submit(
            new Callable<Object>() {
              @Override
              public Object call() throws Exception {
                startLatch.countDown();
                channel.read(buffer, 0);
                return null;
              }
            }));

    futures.add(
        executor.submit(
            new Callable<Object>() {
              @Override
              public Object call() throws Exception {
                startLatch.countDown();
                channel.read(new ByteBuffer[] {buffer, buffer});
                return null;
              }
            }));

    futures.add(
        executor.submit(
            new Callable<Object>() {
              @Override
              public Object call() throws Exception {
                startLatch.countDown();
                channel.read(new ByteBuffer[] {buffer, buffer, buffer}, 0, 2);
                return null;
              }
            }));

    futures.add(
        executor.submit(
            new Callable<Object>() {
              @Override
              public Object call() throws Exception {
                startLatch.countDown();
                channel.transferTo(0, 10, new ByteBufferChannel(buffer));
                return null;
              }
            }));

    futures.add(
        executor.submit(
            new Callable<Object>() {
              @Override
              public Object call() throws Exception {
                startLatch.countDown();
                channel.transferFrom(new ByteBufferChannel(buffer), 0, 10);
                return null;
              }
            }));

    return futures;
  }
Queues blocking operations on the channel in separate threads using the given executor. The
given latch should have a count of BLOCKING_OP_COUNT to allow the caller wants to wait for all
threads to start executing.
jimfs/src/test/java/com/google/common/jimfs/JimfsFileChannelTest.java