class RaftActorContextImpl implements RaftActorContext {

    @Override
    public void updatePeerIds(final ServerConfigurationPayload serverConfig) {
        votingMember = true;
        boolean foundSelf = false;
        Set<String> currentPeers = new HashSet<>(this.getPeerIds());
        for (ServerInfo server : serverConfig.getServerConfig()) {
            if (getId().equals(server.getId())) {
                foundSelf = true;
                if (!server.isVoting()) {
                    votingMember = false;
                }
            } else {
                VotingState votingState = server.isVoting() ? VotingState.VOTING : VotingState.NON_VOTING;
                if (!currentPeers.contains(server.getId())) {
                    this.addToPeers(server.getId(), null, votingState);
                } else {
                    this.getPeerInfo(server.getId()).setVotingState(votingState);
                    currentPeers.remove(server.getId());
                }
            }
        }

        for (String peerIdToRemove : currentPeers) {
            this.removePeer(peerIdToRemove);
        }

        if (!foundSelf) {
            votingMember = false;
        }

        log.debug("{}: Updated server config: isVoting: {}, peers: {}", id, votingMember, peerInfoMap.values());

        setDynamicServerConfigurationInUse();
    }

    public  RaftActorContextImpl(final ActorRef actor, final ActorContext context, final String id,
            final @NonNull ElectionTerm termInformation, final long commitIndex, final long lastApplied,
            final @NonNull Map<String, String> peerAddresses,
            final @NonNull ConfigParams configParams, final @NonNull DataPersistenceProvider persistenceProvider,
            final @NonNull Consumer<ApplyState> applyStateConsumer, final @NonNull Logger logger,
            final @NonNull Executor executor);

}