DiskQueue extends AbstractQueue<String> { @Override protected void finalize() throws Throwable { if (closeFile()) { LOG.warning(MessageFormat.format("{0} still had open file in finalize", DiskQueue.class.getSimpleName())); } super.finalize(); } DiskQueue(int maxInMemorySize);  DiskQueue(int maxInMemorySize, File tempDir); @Override Iterator<String> iterator(); @Override int size(); @Override boolean offer(String element); @Override String peek(); @Override String remove(); @Override String poll(); @Override void clear();  }
@Test public void testFinalize() throws Exception { DiskQueue<String> instance = new DiskQueue<String>(1); try { instance.finalize(); } catch (Throwable ex) { fail(); } }