### Question:
DiskLruCache implements Closeable { public Editor edit(String key) throws IOException { return edit(key, ANY_SEQUENCE_NUMBER); } private  DiskLruCache(File directory, int appVersion, int valueCount, long maxSize); static DiskLruCache open(File directory, int appVersion, int valueCount, long maxSize); synchronized Value get(String key); Editor edit(String key); File getDirectory(); synchronized long getMaxSize(); synchronized void setMaxSize(long maxSize); synchronized long size(); synchronized boolean remove(String key); synchronized boolean isClosed(); synchronized void flush(); synchronized void close(); void delete();  }### Answer:
@Test public void cannotOperateOnEditAfterPublish() throws Exception { DiskLruCache.Editor editor = cache.edit("k1"); editor.set(0, "A"); editor.set(1, "B"); editor.commit(); assertInoperable(editor); }
@Test public void cannotOperateOnEditAfterRevert() throws Exception { DiskLruCache.Editor editor = cache.edit("k1"); editor.set(0, "A"); editor.set(1, "B"); editor.abort(); assertInoperable(editor); }
@Test public void nullKeyThrows() throws Exception { try { cache.edit(null); Assert.fail(); } catch (NullPointerException expected) { } }