### Question:
FileHelper { public static String fromFile(String fileName, String encoding) { InputStream stream = FileHelper.class.getClassLoader().getResourceAsStream(fileName); if (stream == null) { throw new RuntimeFileNotFoundException(new FileNotFoundException(fileName)); } try { return IOUtils.toString(stream, encoding); } catch (IOException e) { throw new RuntimeException("Failed to read from file " + fileName, e); } } private  FileHelper(); static String fromFile(String fileName, String encoding); static String fromFile(String fileName); static FileWithParametersBuilder fromFileWithParameters(String filename); static FileWithParametersBuilder fromFileWithParameters(String filename, String encoding);  }### Answer:
@Test public void readFileFromClasspath() { String fileContent = FileHelper.fromFile("english.txt"); assertThat(fileContent, is("HELLO THIS IS ENGLISH")); }
@Test public void readUtf8FileFromClasspath() { String fileContent = FileHelper.fromFile("japanese.txt"); assertThat(fileContent, is("こんにちは")); }
@Test public void readUtf8FileFromClasspathWithIncorrectEncoding() { String fileContent = FileHelper.fromFile("japanese.txt", "ASCII"); assertThat(fileContent, not(is("こんにちは"))); }
@Test(expected = RuntimeFileNotFoundException.class) public void readMissingFileFromClasspathThrowsException() { FileHelper.fromFile("missing.txt"); }