Workspace implements Serializable { @Override public String toString() { StringBuilder sb = new StringBuilder(2000); sb.append("Project metadata:{\n"); for (int i = 0; i < getProjectCount(); i++) { Project project = getProjects().get(i); ProjectMetadata metadata = getMetadata(project); sb.append("*** ").append(i).append(" = ").append(project); sb.append(" {\n"); if(metadata != null) { sb.append(metadata); } else { sb.append("metadata=null\n"); } sb.append("}\n"); } sb.append("} for (File predefined : getPredefinedFiles()) { sb.append(predefined.getName()).append(","); } sb.append("}\nPreferences files:{"); for (PreferencesFile preferences : getPreferencesFiles()) { sb.append(preferences.getName()).append(","); } sb.append("}"); return sb.toString(); } Workspace(Map<Project, ProjectMetadata> projectMetadata,
            Set<File> predefinedFiles, List<PreferencesFile> preferencesFiles); int getProjectCount(); List<Project> getProjects(); void addProject(Project project); void removeProject(Project project); void addFile(File file, Hierarchy hierarchy); void removeFile(File file, Hierarchy hierarchy); Hierarchy getHierarchy(Project project); Set<File> getFiles(Project project); Set<File> getPredefinedFiles(); List<PreferencesFile> getPreferencesFiles(); @Override String toString();  }
@Test public void testToString() { toStringPrint(workspace); }