### Question:
FileUtil { public static String readStreamAsString(InputStream is) { return readStreamAsString(is, "UTF-8"); }  static OutputStream getOutputStream(File file); static void writeFileAsString(File file, String text); static void writeFileAsString(String filename, String text); static void ensureWriteable(File f); static String readFileAsString(String filename); static String readFileAsString(File file); static String readFileAsString(File file, String encoding); static String readStreamAsString(InputStream is); static String readStreamAsString(InputStream is, String encoding); static void saveObjectAsFile(File file, Object object); static void saveObjectAsFile(String fileName, Object object); @SuppressWarnings("unchecked") static T loadObjectFromFile(File file); static T objectFromBase64String(String base64enc); static String objectToBase64String(Object object); static T loadObjectFromFile(String fileName); static String removeExtension(String fileName); static String removeExtensions(String file); static String getExtension(String fileName); static String ensureSlash(String dirPath); static boolean exists(String path); static String getCanonicalPath(File file); static InputStream fastStream(File file); static byte[] uncompress(byte[] compressed); static String readProcessAsString(Process proc); static PrintStream getFilePrintStream(String filename); static Iterable<String> getRawLines(String filename); static Iterable<String> getLines(String filename); static Iterable<String> getNonCommentLines(String filename); static InputStream getResourceAsStream(String resource); static String readResourceAsString(String resource); static String getFileExists(String... files); static DataOutputStream getDataOutput(String filename); static DataInputStream getDataInput(String filename); static void ensureWorldReadable(File f); static void closeOutputStream(OutputStream os); static byte[] stringToBytes(String str); static String bytesToString(byte[] bs); static Pair<String,String> readProcessAsStringPair(Process process); static void deleteFileOrFolder(String fileName); static String GZIP_EXTN; static String BZIP2_EXTN; static String EXTN_CHR; }### Answer:
@Test public void testReadStreamAsString() throws FileNotFoundException { FileUtil.writeFileAsString(fileName1, fileText); assertEquals(fileText, FileUtil.readStreamAsString(new FileInputStream(new File(fileName1)))); }