AttachmentProxyFile { public static AttachmentProxyFile wrapFile(File fileToWrap) { return new AttachmentProxyFile(fileToWrap, false); } AttachmentProxyFile(File fileToWrap, boolean shouldDeleteOnRelease); static AttachmentProxyFile wrapFile(File fileToWrap); static AttachmentProxyFile extractAttachment(ClientBulletinStore store, AttachmentProxy proxy); File getFile(); void release();  }
@Test public void testWrapFile() throws Exception { File pretendNonTemp = createTempFile(); try { AttachmentProxyFile apf = AttachmentProxyFile.wrapFile(pretendNonTemp); assertEquals(pretendNonTemp, apf.getFile()); apf.release(); assertNull(apf.getFile()); assertTrue(pretendNonTemp.exists()); } finally { pretendNonTemp.delete(); } }