Log implements AutoCloseable { @Override public void close() { assertIsOpen(); flush(); compactor.close(); segments.close(); open = false; } protected  Log(String name, Storage storage, Serializer serializer); Compactor compactor(); Serializer serializer(); boolean isOpen(); boolean isEmpty(); long size(); long length(); long firstIndex(); long lastIndex(); long nextIndex(); T create(Class<T> type); long append(Entry entry); long term(long index); T get(long index); boolean contains(long index); Log release(long index); Log commit(long index); Log skip(long entries); Log truncate(); Log truncate(long index); void flush(); @Override void close(); boolean isClosed(); @Override String toString();  }
@Test(expectedExceptions = IllegalStateException.class) public void appendEntryShouldThrowWhenClosed() throws Exception { log.close(); appendEntries(1); }
@Test(expectedExceptions = IllegalStateException.class) public void testCloseShouldThrowWhenAlreadyClosed() throws Throwable { log.close(); log.close(); }