ProjectMetadata implements Serializable { public void addFile(File file) { Validate.notNull(file, "File can't be null"); File fileToAdd = new File(file, hierarchy.getProject()); files.remove(fileToAdd); files.add(fileToAdd); } @SuppressWarnings("unchecked")  ProjectMetadata(Project project);  ProjectMetadata(Hierarchy hierarchy, Set<File> files); Project getProject(); Set<File> getFiles(); Hierarchy getHierarchy(); void setHierarchy(Hierarchy hierarchy); void addFile(File file); void removeFile(File file); @Override String toString();  }
@Test(expected = IllegalArgumentException.class) public void addFile() { metadata.addFile(null); }