VirtualDir { @Override protected void finalize() throws Throwable { super.finalize(); }  abstract String getBasePath(); Reader getReader(String path); abstract InputStream getInputStream(String path); abstract File getFile(String path); abstract String[] list(String path); abstract String[] listAllFiles(); abstract void close(); static VirtualDir create(File file); abstract boolean isCompressed(); abstract boolean isArchive(); File getTempDir(); @SuppressWarnings({"ResultOfMethodCallIgnored"}) static void deleteFileTree(File treeRoot); static File createUniqueTempDir();  }
@Test public void testFinalize() throws Throwable { File zipFile = getTestDataDir("VirtualDirTest.zip"); final VirtualDir virtualDir = VirtualDir.create(zipFile); final File file1 = virtualDir.getFile("File1"); final File tempDir = virtualDir.getTempDir(); assertNotNull(tempDir); assertTrue(tempDir.isDirectory()); virtualDir.finalize(); assertFalse(tempDir.isDirectory()); }