@Test
public void testNotifyMasterTokenTransitionListeners() {

	// Test 1, notify when master is required
	ClusterMasterExecutorImpl clusterMasterExecutorImpl =
		new ClusterMasterExecutorImpl();
	MockClusterMasterTokenTransitionListener
		mockClusterMasterTokenTransitionListener =
			new MockClusterMasterTokenTransitionListener();
	clusterMasterExecutorImpl.addClusterMasterTokenTransitionListener(
		mockClusterMasterTokenTransitionListener);
	clusterMasterExecutorImpl.notifyMasterTokenTransitionListeners(true);
	Assert.assertTrue(
		mockClusterMasterTokenTransitionListener.
			isMasterTokenAcquiredNotified());
	Assert.assertFalse(
		mockClusterMasterTokenTransitionListener.
			isMasterTokenReleasedNotified());
	// Test 2, notify when master is released
	clusterMasterExecutorImpl = new ClusterMasterExecutorImpl();
	mockClusterMasterTokenTransitionListener =
		new MockClusterMasterTokenTransitionListener();
	clusterMasterExecutorImpl.addClusterMasterTokenTransitionListener(
		mockClusterMasterTokenTransitionListener);
	clusterMasterExecutorImpl.notifyMasterTokenTransitionListeners(false);
	Assert.assertFalse(
		mockClusterMasterTokenTransitionListener.
			isMasterTokenAcquiredNotified());
	Assert.assertTrue(
		mockClusterMasterTokenTransitionListener.
			isMasterTokenReleasedNotified());
}