### Question:
FTPRepository extends AbstractRepository { @Override public Result getResult(String location, String id) { try { cdHome(); cd(super.folder); cd(location); FTPFile[] files; String localFolder = tmpFolder + BAR + location; files = ftp.listFiles(); String imageType = null; for (FTPFile ftpFile : files) { if (ftpFile.getName().startsWith(id + ".")) { (new File(localFolder)).mkdirs(); String extension = FileUtils.getExtension(ftpFile.getName()); if (!extension.equals("txt")) { imageType = extension; } FileOutputStream fos = new FileOutputStream(localFolder + BAR + id + "." + extension); ftp.setBufferSize(1024); ftp.enterLocalPassiveMode(); ftp.enterLocalActiveMode(); ftp.retrieveFile(ftpFile.getName(), fos); fos.close(); } } Result result = new Result(); result.setLocation(location); result.setId(id); File detail = new File(localFolder + BAR + id + ".txt"); if (detail.exists() && detail.isFile()) { result.setDetail(FileUtils.readFile(detail)); } if (imageType != null) { result.setFile(new File(localFolder + BAR + id + "." + imageType)); } return result; } catch (Exception e) { return null; } } FTPRepository(); @Override void connect(); @Override void disconnect(); void save(Result result); @Override void clean(); @Override int countResults(); @Override List<String> getLocations(); @Override Result getResult(String location, String id); @Override List<Result> getResulstByLocation(String location);  }### Answer:
@Test public void testGetResult() { if (connected) { repo.clean(); repo.save(new Result("r1", "ubuntu/chrome", "Ok1")); repo.save(new Result("r2", "ubuntu/chrome", "Ok2")); repo.save(new Result("r3", "ubuntu/chrome", "Ok3")); Assert.assertEquals(3, repo.countResults()); Result result = repo.getResult("ubuntu/chrome", "r2"); assertEquals("r2", result.getId()); assertEquals("Ok2", result.getDetail()); assertNull(result.getFile()); } }