@Test
// DO NOT DELETE THIS TEST! IMPORTANT! VERIFIES THAT SELF-GENERATED NOOPs ARE PROPERLY INITIALIZED
public void shouldInitializeAsLeaderCorrectlyAndCommitLeaderNoopIfQuorumOfAcksReceived() throws StorageException, RPCException {

    // only have the SENTINEL to start
    assertThatLogContains(
            SENTINEL()
    );
    becomeLeaderInTerm(3, false);
    // drain out "I'm leader" messages with the NOOP entry
    Collection<AppendEntries> heartbeats = getRPCs(4, AppendEntries.class);
    assertThatAppendEntriesHaveValues(heartbeats, 3, 0, 0, 0, NOOP(1, 3));
    assertThatNoMoreRPCsWereSent();
    assertThatLogContains(
            SENTINEL(),
            NOOP(1, 3)
    );
    assertThatTermAndCommitIndexHaveValues(3, 0);
    // receive responses from a couple of people (just enough to achieve quorum)
    // saying that they've added the NOOP entry
    algorithm.onAppendEntriesReply(S_01, 3, 0, 1, true);
    algorithm.onAppendEntriesReply(S_02, 3, 0, 1, true);
    // check that we've not done anything funky to the log, but we've bumped our commitIndex
    assertThatLogContains(
            SENTINEL(),
            NOOP(1, 3)
    );
    assertThatTermAndCommitIndexHaveValues(3, 1);
    // verify that we've still got a valid heartbeat scheduled
    // since we haven't moved time at all, the timer's tick is sitting at 0
    // so the scheduled heartbeat is at (currentTick (0) + HEARTBEAT_INTERVAL)
    long heartbeatTimeout = getHeartbeatTimeoutTick();
    assertThat(heartbeatTimeout, equalTo((long) RaftConstants.HEARTBEAT_INTERVAL));
}