source: class LeaderContextTest {
  
  	@Mock
  	private Candidate mockCandidate;
  	@Mock
  	private LeadershipController mockLeadershipController;
  	@Mock
  	private Leader mockLeader;
  	private LeaderContext leaderContext;
  
  	@Test
  	public void testIsLeaderWhenLeader() {
  
target: 		given(this.mockLeadershipController.getLocalLeader()).willReturn(Optional.of(this.mockLeader));
  		given(this.mockLeader.isCandidate(this.mockCandidate)).willReturn(true);
  
  		boolean result = this.leaderContext.isLeader();
  
  		assertThat(result).isTrue();
  	}
  
  }