1@Test
2public void givenWritingStringToFile_whenUsingPrintWriter_thenCorrect()
3 throws IOException {
4 FileWriter fileWriter = new FileWriter(fileName);
5 PrintWriter printWriter = new PrintWriter(fileWriter);
6 printWriter.print("Some String");
7 printWriter.printf("Product name is %s and its price is %d $", "iPhone", 1000);
8 printWriter.close();
9}