### Question:
FileUtils { public static File locateFile(String fileName) { if (fileName == null) { return null; } File aFile = locateFileOrDirectory(fileName); if ((aFile != null) && aFile.isFile()) { return aFile; } return null; } private  FileUtils(); static File locateFile(String fileName); static File locateDirectory(String directoryName); static String readFile(String fileName);  }### Answer:
@Test public void testLocateFileForNull() { File aFile = FileUtils.locateFile(null); assertNull(aFile); }
@Test public void testLocateFileAsResource() { String fileName = "/service-configuration.yml"; File aFile = FileUtils.locateFile(fileName); assertNotNull(aFile); assertEquals("service-configuration.yml", aFile.getName()); assertTrue(aFile.canRead()); fileName = "service-configuration.yml"; aFile = FileUtils.locateFile(fileName); assertNotNull(aFile); assertEquals("service-configuration.yml", aFile.getName()); assertTrue(aFile.canRead()); }