### Question:
FileUtilities { public static File ensureSuffix(File file, String suffix) { if (suffix.equalsIgnoreCase(getSuffix(file))) { return file; } return new File(new StringBuilder(file.getPath()).append('.').append(suffix).toString()); } private  FileUtilities(); static boolean archive(Path file); static boolean copyDirectory(File source, File destination, boolean copySubDirectories); static boolean copyfile(File srFile, File dtFile); static boolean createDirectories(File dir); static boolean createDirectoriesAndFile(File file); static boolean deleteDirRecursive(File fileOrDir); static File ensureSuffix(File file, String suffix); static List<String> explodeZip(InputStream inStream, File outputLocation, long seed); static String getBasename(File file); static String getDirectory(File baseDirectory, long seed); static long getDirSize(File file); static List<File> getFilesFromDirectory(File directory, final String extension); static String getSuffix(File file); static String getSuffix(String file); static ByteBuffer readFileToBuffer(File in); static List<String> readLines(File file);  }### Answer:
@Test public void testEnsureSuffix() { File fullName = new File("C:\\path.dir\\last." + XYZ); Assert.assertEquals(fullName, FileUtilities.ensureSuffix(fullName, XYZ)); Assert.assertEquals(fullName, FileUtilities.ensureSuffix(new File("C:\\path.dir\\last"), XYZ)); }