### Question:
CachingLocation implements LinkableLocation { @Override public boolean delete() throws IOException { return delegate.delete(); } CachingLocation(LocationFactory locationFactory, Location delegate, CachingPathProvider cachingPathProvider); @Override boolean tryLink(Path target); @Override boolean exists(); @Override String getName(); @Override boolean createNew(); @Override boolean createNew(String permission); @Override String getPermissions(); @Override String getOwner(); @Override String getGroup(); @Override void setGroup(String group); @Override void setPermissions(String permission); @Override InputStream getInputStream(); @Override OutputStream getOutputStream(); @Override OutputStream getOutputStream(String permission); @Override Location append(String child); @Override Location getTempFile(String suffix); @Override URI toURI(); @Override boolean delete(); @Override boolean delete(boolean recursive); @Override @Nullable Location renameTo(Location destination); @Override boolean mkdirs(); @Override boolean mkdirs(String permission); @Override long length(); @Override long lastModified(); @Override boolean isDirectory(); @Override List<Location> list(); @Override LocationFactory getLocationFactory(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test (expected = IOException.class) public void testDelete() throws IOException { Path cachePath = TEMP_FOLDER.newFolder().toPath(); String message = "Testing message"; DefaultCachingPathProvider cacheProvider = new DefaultCachingPathProvider(cachePath, 1, TimeUnit.HOURS); LocationFactory lf = new CachingLocationFactory(new LocalLocationFactory(TEMP_FOLDER.newFolder()), cacheProvider); Location location = lf.create("test"); try (OutputStream os = location.getOutputStream()) { os.write(message.getBytes(StandardCharsets.UTF_8)); } try (InputStream is = location.getInputStream()) { Assert.assertEquals(message, new String(ByteStreams.toByteArray(is), StandardCharsets.UTF_8)); } location.delete(); location.getInputStream(); }