### Question:
UtilFile { public static List<File> getFilesByExtension(File path, String extension) { Check.notNull(path); Check.notNull(extension); final List<File> filesList = new ArrayList<>(1); getFilesByExtensionRecursive(filesList, path, extension); return filesList; } private  UtilFile(); static String removeExtension(String file); static String normalizeExtension(String file, String extension); static String getExtension(String file); static String getExtension(File file); static List<File> getFiles(File directory); static List<File> getFilesByExtension(File path, String extension); static List<File> getFilesByName(File path, String name); static void deleteFile(File file); static boolean exists(String path); static boolean isFile(String path); static boolean isType(File file, String extension);  }### Answer:
@Test void testGetFilesByExtension() throws IOException { assertTrue(UtilFile.getFilesByExtension(new File("void"), "txt").isEmpty()); final Path folder = Files.createTempDirectory("temp"); final Path file1 = Files.createTempFile(folder, "temp", ".tmp"); final Path file2 = Files.createTempFile(folder, "temp", ".txt"); final Path folder2 = Files.createTempDirectory(folder, "temp"); final Path file3 = Files.createTempFile(folder2, "temp", ".txt"); final List<File> expected = Arrays.asList(file2.toFile(), file3.toFile()); final List<File> result = UtilFile.getFilesByExtension(folder.toFile(), "txt"); Collections.sort(expected); Collections.sort(result); assertIterableEquals(expected, result); Files.delete(file1); Files.delete(file2); Files.delete(file3); Files.delete(folder2); Files.delete(folder); }