### Question:
TempFileGenerator implements FileGenerator { @Override public File getTemporaryFile() throws FileCreationException { String fileName = RandomStringUtils.randomAlphanumeric(Constants.FILE_NAME_LENGTH).toLowerCase(); File tempFile = new File(pathToFolder + Constants.FILE_SEPARATOR + fileName); try { tempFile.createNewFile(); } catch (IOException e) { throw new FileCreationException("Could not create temporary file."); } tempFile.deleteOnExit(); createdFiles.add(tempFile); return tempFile; } TempFileGenerator(); @Override File getTemporaryFile(); @Override void close();  }### Answer:
@Test public void testGetTemporaryFile() throws IOException, FileCreationException { TempFileGenerator tempFileGenerator = new TempFileGenerator(); File actualFile = tempFileGenerator.getTemporaryFile(); assertTrue(actualFile.exists()); assertTrue(actualFile.isFile()); assertTrue(actualFile.canRead()); assertTrue(actualFile.canWrite()); assertEquals(0, actualFile.length()); tempFileGenerator.close(); }