### Question:
TailableFile implements Closeable { private void restoreState(Properties state) throws IOException { long position = Long.parseLong(state.getProperty("position", "0")); long creationTime = Long.parseLong(state.getProperty("creationTime", Long.toString(getCreationTime(file.toPath())))); long inode = Long.parseLong(state.getProperty("inode", Long.toString(getInode(file.toPath())))); if (hasRotated(creationTime, inode)) { openRotatedFile(position, creationTime, inode); } else { openExistingFile(position, file.toPath()); } } TailableFile(File file); void deleteStateFileOnExit(); void ack(); void nak(); int tail(ByteBuffer buffer, FileChangeListener listener, int maxLines); @Override void close(); File getFile(); @Override String toString();  }### Answer:
@Test void testRestoreState() throws Exception { tailableFile.tail(buffy, logListener, 1); assertThat(logListener.lines).hasSize(1); assertThat(logListener.lines.get(0)).isEqualTo("foo"); tailableFile.ack(); tailableFile.close(); setUp(); tailableFile.tail(buffy, logListener, 1); assertThat(logListener.lines).hasSize(2); assertThat(logListener.lines.get(1)).isEqualTo("bar"); }