### Question:
Files { public static Path copyResource(String resourceName, Path destination, OpenOption... options) throws IOException { return copyResource(Files.class.getClassLoader(), resourceName, destination, options); } private  Files(); static boolean createFileIfMissing(Path path, FileAttribute<?>... attrs); static void deleteRecursively(Path directory); static Path copyResource(String resourceName, Path destination, OpenOption... options); static Path copyResource(ClassLoader classloader, String resourceName, Path destination, OpenOption... options); static long copyResource(String resourceName, OutputStream out); static long copyResource(ClassLoader classloader, String resourceName, OutputStream out); static void atomicReplace(Path path, byte[] bytes); static void atomicReplace(Path path, IOConsumer<Writer> fn); static void atomicReplace(Path path, Charset charset, IOConsumer<Writer> fn);  }### Answer:
@Test void canCopyResources(@TempDirectory Path tempDir) throws Exception { Files.createDirectories(tempDir.resolve("org/something")); Files.write(tempDir.resolve("org/something/test.txt"), "foo".getBytes(StandardCharsets.UTF_8)); URLClassLoader classLoader = new URLClassLoader(new URL[] {new URL("file:" + tempDir.toString() + "/")}); Path file = copyResource(classLoader, "org/something/test.txt", tempDir.resolve("test.txt")); assertTrue(Files.exists(file)); assertEquals(3, Files.size(file)); }