### Question:
InputDataFinder { File[] retrieveCsvTsvFiles(String pathToFolder, boolean dir) throws UnsupportedEncodingException { File folder = new File(URLDecoder.decode(pathToFolder, Constants.FILE_ENCODING)); List<File> allFiles = new ArrayList<>(); File[] currentFiles = folder.listFiles(); if (currentFiles != null) { for (File currentFile : currentFiles) { if (currentFile.isDirectory()) { File[] dirFiles = retrieveCsvTsvFiles(currentFile.getPath(), dir); if (dir == true) { allFiles.add(currentFile); } Collections.addAll(allFiles, dirFiles); } else if (currentFile.isFile()) { for (String fileEnding : Constants.ACCEPTED_FILE_ENDINGS_ARRAY) { if (currentFile.getName().endsWith(fileEnding)) { allFiles.add(currentFile); } } } } } else { return new File[0]; } return allFiles.toArray(new File[allFiles.size()]); }  File[] getAvailableFiles(boolean dir); String getFileDirectory();  }### Answer:
@Test public void testRetrieveFiles() throws UnsupportedEncodingException { String pathToAlgorithmsFolder = Thread.currentThread().getContextClassLoader().getResource(Constants.ALGORITHMS_RESOURCE_NAME).getPath(); String pathToCsvFolder = Thread.currentThread().getContextClassLoader().getResource(Constants.INPUTDATA_RESOURCE_NAME).getPath(); File[] filesInAlgorithmsFolder = inputDataFinder.retrieveCsvTsvFiles(pathToAlgorithmsFolder, true); File[] filesInInputFolder = inputDataFinder.retrieveCsvTsvFiles(pathToCsvFolder, true); assertEquals(0, filesInAlgorithmsFolder.length); assertEquals(10, filesInInputFolder.length); }