### Question:
Utilities { public static File createTempFile(final Object forObject) { try { final String filePrefix = forObject.getClass().getName(); final String fileSuffix = randomUUID().toString(); final File tempFile = Files.createTempFile(filePrefix, fileSuffix).toFile(); tempFile.deleteOnExit(); return tempFile; } catch (final IOException e) { throw new AssertionError("Could not create temp file!", e); } }  static File createTempFile(final Object forObject);  }### Answer:
@Test public void testTempFileCreation() { final File tempFile = Utilities.createTempFile(this); try { write(TEST_DATA.getBytes(), tempFile); } catch (final IOException e) { log.error(e.getLocalizedMessage()); fail("Failed to write to temp file!"); } try { final String firstLine = readFirstLine(tempFile, UTF_8); assertEquals(TEST_DATA, firstLine); } catch (final IOException e) { log.error(e.getLocalizedMessage()); fail("Failed to read from temp file!"); } }