### Question:
FileUtils { public static File createTempFile(final String name) { if (name == null) { throw new NullPointerException("Please supply a file name"); } File dir = createTempDir(); File temp = new File(dir, name); temp.deleteOnExit(); return temp; }  static File createTempDir(); static File createTempFile(final String name);  }### Answer:
@Test(expected = NullPointerException.class) public void shouldThrowNullPointer() { FileUtils.createTempFile(null); }
@Test public void shouldCreateUniqueFile() { File file = FileUtils.createTempFile("test.txt"); assertNotNull(file); assertEquals("test.txt".length(), file.getName().length()); }