RequestQueue<ReadRequest> getReadRequestQueue(FileIOChannel.ID channelID) {
        return this.readers[channelID.getThreadNum()].requestQueue;
    }
@Test
    void testExceptionInCallbackRead() throws Exception {
        final AtomicBoolean handlerCalled = new AtomicBoolean();

        ReadRequest regularRequest =
                new ReadRequest() {

                    @Override
                    public void requestDone(IOException ioex) {
                        synchronized (handlerCalled) {
                            handlerCalled.set(true);
                            handlerCalled.notifyAll();
                        }
                    }

                    @Override
                    public void read() {}
                };

        ReadRequest exceptionThrower =
                new ReadRequest() {

                    @Override
                    public void requestDone(IOException ioex) {
                        throw new RuntimeException();
                    }

                    @Override
                    public void read() {}
                };

        RequestQueue<ReadRequest> rq = ioManager.getReadRequestQueue(ioManager.createChannel());

        // queue first an exception thrower, then a regular request.
        // we check that the regular request gets successfully handled
        rq.add(exceptionThrower);
        rq.add(regularRequest);

        synchronized (handlerCalled) {
            while (!handlerCalled.get()) {
                handlerCalled.wait();
            }
        }
    }