ProjectMetadata implements Serializable { public Set<File> getFiles() { return Collections.unmodifiableSet(files); } @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 = UnsupportedOperationException.class) public void getFiles() { metadata.getFiles().add(new File()); }
@Test public void getFiles2() { File file = (File) CollectionUtils.get(metadata.getFiles(), 0); file.setName("new_name"); File another = (File) CollectionUtils.get(metadata.getFiles(), 0); assertTrue(file.equals(another)); }