### Question:
FileUtils { public Boolean deleteFile( String aFileName ) { boolean result = false; String path = getRelativeSolutionPath(); File file = new File( path + File.separatorChar + aFileName ); System.err.println( "File not null " + file != null ); System.err.println( "File path " + file.getAbsolutePath() ); System.err.println( "File exist " + file.exists() ); if ( file.exists() ) { result = file.delete(); } return result; }  FileInfo[] listFiles(); Boolean deleteFile( String aFileName ); static final String DEFAULT_RELATIVE_UPLOAD_FILE_PATH; }### Answer:
@Test public void testDeleteFile() { FileUtils fu = new FileUtils(); String testUniqueFileName = "testFileToDelete-" + System.currentTimeMillis(); File testUniqueFile = new File( fu.getRelativeSolutionPath() + File.separatorChar + testUniqueFileName ); try { testUniqueFile.createNewFile(); } catch ( IOException ioe ) { fail( "File creation failed" ); } if ( !testUniqueFile.exists() ) { fail( "File could not be created" ); } FileInfo [] files = fu.listFiles(); if ( files != null && files.length > 0 ) { fu.deleteFile( testUniqueFileName ); FileInfo [] files1 = fu.listFiles(); System.err.println( "File1 length " + files1.length ); System.err.println( "Files length " + files.length ); try { assertTrue( files1.length < files.length ); } finally { for ( FileInfo file : files1 ) { if ( file.getName().contains( testUniqueFileName ) ) { testUniqueFile.deleteOnExit(); fail( "File should have been deleted. We will delete the file ourselves" ); } } } } }