@Override
    public boolean setVotedFor(final PeerId peerId) {
        checkState();
        this.votedFor = peerId;
        return save();
    }
@Test
    public void testSaveFail() throws IOException {
        FileUtils.deleteDirectory(new File(this.path));
        assertFalse(this.raftMetaStorage.setVotedFor(new PeerId("localhost", 8081)));
        Mockito.verify(this.node, Mockito.times(1)).onError((RaftException) Mockito.any());
    }