### Question:
DiffReport { public DiffFile getFile(List<String> sourceLocations, String filename, SourceDiffState state) { for(String baseLocation : sourceLocations) { String searchFileName = (new File(baseLocation + "/", filename)).getAbsolutePath(); DiffFile searchedFile = changedFiles.getFile(searchFileName); if (searchedFile != null && searchedFile.getSourceState() == state) { return searchedFile; } } return null; } DiffReport(String originalDirectory, String revisedDirectory); String getOriginalDirectory(); String getRevisedDirectory(); DiffDirectory getChangedFiles(); DiffDirectory getDirectory(String directoryName); DiffFile getFile(List<String> sourceLocations, String filename, SourceDiffState state); List<DiffFile> getFiles(List<String> sourceLocations, String filename);  }### Answer:
@Test public void testGetFile() { ArrayList<String> sourceLocations = new ArrayList<String>(); sourceLocations.add(new File("src/test/resources/simpleMavenProject/src/main/java").getAbsolutePath()); sourceLocations.add(new File("src/test/resources/simpleMavenProject2/src/main/java").getAbsolutePath()); DiffReport diffReport; try { diffReport = new DiffReport("src/test/resources/simpleMavenProject", "src/test/resources/simpleMavenProject2"); DiffFile file = diffReport.getFile(sourceLocations, "simpleMavenProject/Simple.java", SourceDiffState.DELETED); assertNotNull(file); assertEquals((new File("src/test/resources/simpleMavenProject", "src/main/java/simpleMavenProject/Simple.java")).getAbsolutePath(), file.getOriginalFileName()); file = diffReport.getFile(sourceLocations, "simpleMavenProject/Simple2.java", SourceDiffState.NEW); assertNotNull(file); assertEquals((new File("src/test/resources/simpleMavenProject2", "src/main/java/simpleMavenProject/Simple2.java")).getAbsolutePath(), file.getRevisedFileName()); file = diffReport.getFile(sourceLocations, "simpleMavenProject/DOESNOTEXISTS.java", SourceDiffState.NEW); assertNull(file); } catch (IOException e) { fail(); } }