@Override
    public void onChange(Job job) {
        sendObject(job);
        if (job.hasState(SUCCEEDED) || job.hasState(FAILED) || job.hasState(DELETED)) {
            close();
        }
    }
@Test
    void sseConnectionIsClosedIfJobStateIsDeleted() throws IOException {
        JobSseExchange jobSseExchange = new JobSseExchange(httpExchange, storageProvider, new JacksonJsonMapper());

        jobSseExchange.onChange(aDeletedJob().build());

        verify(storageProvider).removeJobStorageOnChangeListener(jobSseExchange);
    }