@Test
public void testLocalPeerIsNotLeader() throws Exception {

    long localPeerId = 7;
    QuorumPeer peer = mock(QuorumPeer.class);
    when(peer.getId()).thenReturn(localPeerId);
    when(peer.isLeader(eq(localPeerId))).thenReturn(false);
    LocalPeerBean localPeerBean = new LocalPeerBean(peer);
    assertFalse(localPeerBean.isLeader());
}