class RaftActor extends AbstractUntypedPersistentActor {

    private void switchBehavior(final SwitchBehavior message) {
        if (!getRaftActorContext().getRaftPolicy().automaticElectionsEnabled()) {
            RaftState newState = message.getNewState();
            if (newState == RaftState.Leader || newState == RaftState.Follower) {
                getRaftActorContext().getTermInformation().updateAndPersist(message.getNewTerm(), "");
                switchBehavior(behaviorStateTracker.capture(getCurrentBehavior()),
                    AbstractRaftActorBehavior.createBehavior(context, message.getNewState()));
            } else {
                LOG.warn("Switching to behavior : {} - not supported", newState);
            }
        }
    }

    protected  RaftActor(final String id, final Map<String, String> peerAddresses,
         final Optional<ConfigParams> configParams, final short payloadVersion);

}