public boolean offer(Serializable event) {
        if (queue == null) {
            throw new IllegalStateException("client has no event queue");
        }
        return queue.offer(event);
    }
@Test
    public void testOfferEventSequenceAndRun() throws Exception {
        for (int i = 0; i < 10; i++) {
            client.offer(TEST_EVENT + i);
        }

        Thread thread = new Thread(client);
        thread.start();
        thread.join(1000);
        Assertions.assertFalse(thread.isAlive());

        ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(outputStream.toByteArray()));
        for (int i = 0; i < 10; i++) {
            Assertions.assertEquals(TEST_EVENT + i, ois.readObject());
        }
    }