### Question:
FileUtils { public static List<File> getFiles(File dir, final String pattern) { List<File> fileList = new ArrayList<>(); File[] files = dir.listFiles(); if (files != null) { Pattern p = Pattern.compile(pattern); for (File file : files) { Matcher m = p.matcher(file.getName()); if (m.matches()) { fileList.add(file); } } } return fileList; } private  FileUtils(); static boolean isValidFileName(String name); static synchronized File getDefaultTempDir(); static synchronized void maybeDeleteDefaultTempDir(); static File createTmpDir(); static File createTmpDir(boolean addHook); static void mkDir(File dir); static void removeDir(File d); static void delete(File f); static void delete(File f, boolean inShutdown); static File createTempFile(String prefix, String suffix); static File createTempFile(String prefix, String suffix, File parentDir,
                               boolean deleteOnExit); static List<File> getFilesUsingSuffix(File dir, final String suffix); static List<File> getFilesRecurseUsingSuffix(File dir, final String suffix); static List<File> getFiles(File dir, final String pattern); static List<String> readLines(File file); static boolean exists(File file); static String stripPath(String name);  }### Answer:
@Test public void testGetFiles() throws URISyntaxException { URL resource = FileUtilsTest.class.getResource("FileUtilsTest.class"); File directory = Paths.get(resource.toURI()).getParent().toFile(); assertTrue(directory.exists()); List<File> foundFiles = FileUtils.getFilesUsingSuffix(directory, ".class"); assertFalse(foundFiles.isEmpty()); List<File> foundFiles2 = FileUtils.getFiles(directory, ".*\\.class$"); assertEquals(foundFiles, foundFiles2); }