@Test
public void testOnNewLeader() {

    setup("testOnNewLeader");
    cohort.setNewLeaderTimeoutInMillis(20000);
    cohort.onNewLeader("new-leader");
    verify(onComplete, never()).onSuccess(mockRaftActor.self());
    cohort.transferComplete();
    cohort.onNewLeader(null);
    verify(onComplete, never()).onSuccess(mockRaftActor.self());
    cohort.onNewLeader("new-leader");
    verify(onComplete).onSuccess(mockRaftActor.self());
}