ExcelFileUtils { public static File getFile(File directory, String prefix, LocalDate date, String extension) throws IOException { assert date != null : "You must provide a date!"; String suffix = date.format(DateTimeFormatter.ofPattern("yyyyMMdd")); return getFile(directory, prefix, suffix, extension); } private  ExcelFileUtils(); static File getFile(File directory, String prefix, LocalDate date, String extension); static File getFile(File directory, String prefix, String suffix, String extension); static String getFileName(File file); static String getFileExtension(File file); static List<LocalDate> generateListOfDates();  }
@Test public void testGetFile() throws Exception { File expected = new File("./prefix 20000101.exe"); File actual = ExcelFileUtils.getFile(new File("./"), "prefix", LocalDate.of(2000, 1, 1), ".exe"); assertEquals(expected, actual); }
@Test public void testGetFile1() throws Exception { File expected = new File("./prefix suffix.exe"); File actual = ExcelFileUtils.getFile(new File("./"), "prefix", "suffix", ".exe"); assertEquals(expected, actual); }