public ZLoop(Context context)
    {
        Objects.requireNonNull(context, "Context has to be supplied for ZLoop");
        this.context = context;

        pollers = new ArrayList<>();
        timers = new ArrayList<>();
        zombies = new ArrayList<>();
        newTimers = new ArrayList<>();
    }
@Test
    public void testZLoop()
    {
        int rc;

        // setUp() should create the context
        assert (ctx != null);

        ZLoop loop = new ZLoop(ctx);
        assert (loop != null);

        ZLoop.IZLoopHandler timerEvent = (loop12, item, arg) -> {
            ((Socket) arg).send("PING", 0);
            return 0;
        };

        ZLoop.IZLoopHandler socketEvent = (loop1, item, arg) -> {
            received = ((Socket) arg).recvStr(0);
            //  Just end the reactor
            return -1;
        };

        //  After 10 msecs, send a ping message to output
        loop.addTimer(10, 1, timerEvent, input);

        //  When we get the ping message, end the reactor
        PollItem pollInput = new PollItem(output, Poller.POLLIN);
        rc = loop.addPoller(pollInput, socketEvent, output);
        Assert.assertEquals(0, rc);
        loop.start();

        loop.removePoller(pollInput);
        Assert.assertEquals("PING", received);
    }