### Question:
LocalRaftMetaStorage implements RaftMetaStorage { @Override public boolean setVotedFor(final PeerId peerId) { checkState(); this.votedFor = peerId; return save(); } LocalRaftMetaStorage(final String path, final RaftOptions raftOptions); @Override boolean init(final RaftMetaStorageOptions opts); @Override void shutdown(); @Override boolean setTerm(final long term); @Override long getTerm(); @Override boolean setVotedFor(final PeerId peerId); @Override PeerId getVotedFor(); @Override boolean setTermAndVotedFor(final long term, final PeerId peerId); @Override String toString();  }### Answer:
@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()); }