Raft algorithm implementation in Java