PredefinedFileDaoImpl implements PredefinedFileDao,
        ServletContextAware { @Override public File findByName(String name) { Validate.notNull(name, "Name can't be null"); File file = files.get(name); if (file != null) { file = new File(file); } return file; }  void setLocation(java.io.File location); java.io.File getLocation(); @Override void setServletContext(ServletContext servletContext); @PostConstruct void initFiles(); @Override Set<File> getPredefinedFiles(); @Override File findByName(String name);  }
@Test public void findByName() { assertNull(dao.findByName("non existing predefined file name")); assertNotNull(dao.findByName("PREDEFINED_FILE1")); }