### Question:
Files { public static File writeToTemp(InputStream in) throws IOException { return writeFileToDirectory(in, TEMP_DIR); } private  Files(); static File writeToTemp(InputStream in); static File writeFileToDirectory(InputStream in, String path); static final String JAVA_IO_TMP_DIR; static final String TEMP_DIR; }### Answer:
@Test public void writeToTemp() throws Exception { String testSentence = "asdasdaiğçşsdasdasdasdasd"; ByteArrayInputStream inputStream = new ByteArrayInputStream(testSentence.getBytes("UTF-8")); File file = Files.writeToTemp(inputStream); FileInputStream fileInputStream = new FileInputStream(file); byte[] buffer = new byte[testSentence.getBytes("UTF-8").length]; fileInputStream.read(buffer); fileInputStream.close(); assert new String(buffer, "UTF-8").equals(testSentence); file = Files.writeToTemp(null); assert file.length() == 0; }