### Question:
FileUtils { public static InputStream getInputStream(final Class<?> loadingClass, final String filename) { final InputStream inputStream = loadingClass.getResourceAsStream(filename); Validate.notNull(inputStream, "Could not locate '%s' in classpath of %s", filename, loadingClass.getName()); return inputStream; } private  FileUtils(); static String backOneDirectory(String fileIdentifier); static boolean copyRecursively(final File source, final File destination,
      final boolean deleteDestinationOnExit); static String ensureTrailingSeparator(final String path); static String getCanonicalPath(final File file); static String getFileSeparatorAsRegex(); static String getFirstDirectory(String fileIdentifier); static InputStream getInputStream(final Class<?> loadingClass, final String filename); static String getPath(final Class<?> loadingClass, final String relativeFilename); static String getSystemDependentPath(final Collection<String> pathElements); static String getSystemDependentPath(final String... pathElements); static boolean matchesAntPath(final String antPattern, final String canonicalPath); static final String CURRENT_DIRECTORY; }### Answer:
@Test public void testGetInputStreamOfFileInSubDirectory() throws Exception { final InputStream inputStream = FileUtils.getInputStream(Loader.class, TEST_FILE); final String contents = IOUtils.toString(inputStream); assertEquals("This file is required for FileUtilsTest.", contents); }
@Test(expected = NullPointerException.class) public void testGetInputStreamOfInvalidFile() throws Exception { FileUtils.getInputStream(Loader.class, MISSING_FILE); }