    @Test
    public void testIsLeader() throws Exception {

        HostInfo info = EasyMock.createNiceMock(HostInfo.class);
        EasyMock.expect(info.getZoneName()).andReturn("zone").anyTimes();
        EasyMock.replay(info);

        HazelcastAgent agent = new HazelcastAgent(SERVICE, info, MONITOR);
        List<Boolean> listenerFired = new ArrayList<>();
        agent.registerLeadershipListener(listenerFired::add);

        Assert.assertTrue(agent.isLeader());
        Assert.assertFalse(listenerFired.isEmpty());
    }