### Question:
DiskBasedCache implements Cache { static int readInt(InputStream is) throws IOException { int n = 0; n |= (read(is) << 0); n |= (read(is) << 8); n |= (read(is) << 16); n |= (read(is) << 24); return n; } DiskBasedCache(File rootDirectory, int maxCacheSizeInBytes);  DiskBasedCache(File rootDirectory); @Override synchronized void clear(); @Override synchronized Entry get(String key); @Override synchronized void initialize(); @Override synchronized void invalidate(String key, boolean fullExpire); @Override synchronized void put(String key, Entry entry); @Override synchronized void remove(String key); File getFileForKey(String key);  }### Answer:
@Test public void testEmptyReadThrowsEOF() throws IOException { ByteArrayInputStream empty = new ByteArrayInputStream(new byte[]{}); exception.expect(EOFException.class); DiskBasedCache.readInt(empty); }