ExcelFileUtils { public static String getFileName(File file) { String originalFileName = file.getName(); int extensionIndex = originalFileName.lastIndexOf("."); return originalFileName.substring(0, extensionIndex); } 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 testGetFileName() throws Exception { String expected = "foo"; String actual = ExcelFileUtils.getFileName(new File("./foo.bar")); assertEquals(expected, actual); }