### Question:
Resources { public static File getResourceAsFile(String resource) throws IOException { return new File(getResourceURL(resource).getFile()); } Resources(); static ClassLoader getDefaultClassLoader(); static void setDefaultClassLoader(ClassLoader defaultClassLoader); static URL getResourceURL(String resource); static URL getResourceURL(ClassLoader loader, String resource); static InputStream getResourceAsStream(String resource); static InputStream getResourceAsStream(ClassLoader loader, String resource); static Properties getResourceAsProperties(String resource); static Properties getResourceAsProperties(ClassLoader loader, String resource); static Reader getResourceAsReader(String resource); static Reader getResourceAsReader(ClassLoader loader, String resource); static File getResourceAsFile(String resource); static File getResourceAsFile(ClassLoader loader, String resource); static InputStream getUrlAsStream(String urlString); static Reader getUrlAsReader(String urlString); static Properties getUrlAsProperties(String urlString); static Class<?> classForName(String className); static Charset getCharset(); static void setCharset(Charset charset);  }### Answer:
@Test void shouldGetResourceAsFile() throws Exception { File file = Resources.getResourceAsFile(JPETSTORE_PROPERTIES); assertTrue(file.getAbsolutePath().replace('\\', '/').endsWith("jpetstore/jpetstore-hsqldb.properties")); }
@Test void shouldGetResourceAsFileWithClassloader() throws Exception { File file = Resources.getResourceAsFile(CLASS_LOADER, JPETSTORE_PROPERTIES); assertTrue(file.getAbsolutePath().replace('\\', '/').endsWith("jpetstore/jpetstore-hsqldb.properties")); }
@Test public void shouldGetResourceAsFile() throws Exception { File file = Resources.getResourceAsFile(JPETSTORE_PROPERTIES); assertTrue(file.getAbsolutePath().replace('\\', '/').endsWith("jpetstore/jpetstore-hsqldb.properties")); }
@Test public void shouldGetResourceAsFileWithClassloader() throws Exception { File file = Resources.getResourceAsFile(CLASS_LOADER, JPETSTORE_PROPERTIES); assertTrue(file.getAbsolutePath().replace('\\', '/').endsWith("jpetstore/jpetstore-hsqldb.properties")); }