### Question:
ZkClusterControllerLeaderSelectorListener implements LeaderSelectorListener { @Override public void takeLeadership(CuratorFramework curatorFramework) throws Exception { controller.processAsLeader(); } ZkClusterControllerLeaderSelectorListener(ClusterControllerLeader controller); @Override void takeLeadership(CuratorFramework curatorFramework); @Override void stateChanged(CuratorFramework client, ConnectionState newState);  }### Answer:
@Test public void testTakeLeadership() throws Exception { ClusterControllerLeader leaderLogic = mock(ClusterControllerLeader.class); ZkClusterControllerLeaderSelectorListener listener = new ZkClusterControllerLeaderSelectorListener(leaderLogic); CuratorFramework curator = mock(CuratorFramework.class); listener.takeLeadership(curator); verify(leaderLogic, times(1)).processAsLeader(); }