@Override
    public boolean registerAllRequestsProcessedListener(NotificationListener listener)
            throws IOException {
        return super.registerAllRequestsProcessedListener(listener);
    }
@Test
    void testSubscribeAndClose() throws Exception {
        final TestNotificationListener listener = new TestNotificationListener();

        addRequest();
        addRequest();

        writer.registerAllRequestsProcessedListener(listener);

        final CheckedThread asyncCloseThread =
                new CheckedThread() {
                    @Override
                    public void go() throws Exception {
                        writer.close();
                    }
                };

        asyncCloseThread.start();

        handleRequest();
        handleRequest();

        asyncCloseThread.sync();

        assertThat(listener.getNumberOfNotifications())
                .withFailMessage("Listener was not notified.")
                .isOne();
    }