AbstractExtension implements MutableExtension { @Override public void set(Extension extension) { setName(extension.getName()); setDescription(extension.getDescription()); setAuthors(extension.getAuthors()); setWebsite(extension.getWebSite()); setLicenses(extension.getLicenses()); setSummary(extension.getSummary()); setIssueManagement(extension.getIssueManagement()); setScm(extension.getScm()); setCategory(extension.getCategory()); setExtensionFeatures(extension.getExtensionFeatures()); setAllowedNamespaces(extension.getAllowedNamespaces()); setDependencies(extension.getDependencies()); setManagedDependencies(extension.getManagedDependencies()); setRepositories(extension.getRepositories()); setProperties(extension.getProperties()); } AbstractExtension(ExtensionRepository repository, ExtensionId id, String type);  AbstractExtension(ExtensionRepository repository, Extension extension); @Override void set(Extension extension); @Override T get(String fieldName); @Override ExtensionId getId(); @Override @Deprecated Collection<String> getFeatures(); @Override @Deprecated void setFeatures(Collection<String> features); @Override @Deprecated void addFeature(String feature); @Override Collection<ExtensionId> getExtensionFeatures(); @Override ExtensionId getExtensionFeature(String featureId); @Override void setExtensionFeatures(Collection<ExtensionId> features); @Override void addExtensionFeature(ExtensionId feature); @Override String getType(); @Override String getName(); @Override void setName(String name); @Override Collection<ExtensionLicense> getLicenses(); @Override void setLicenses(Collection<ExtensionLicense> licenses); @Override void addLicense(ExtensionLicense license); @Override String getSummary(); @Override void setSummary(String summary); @Override String getDescription(); @Override void setDescription(String description); @Override List<ExtensionAuthor> getAuthors(); @Override void setAuthors(Collection<? extends ExtensionAuthor> authors); @Override void addAuthor(ExtensionAuthor author); @Override String getWebSite(); @Override void setWebsite(String website); @Override Collection<String> getAllowedNamespaces(); @Override void addAllowedNamespace(String namespace); @Override void setAllowedNamespaces(Collection<String> namespaces); @Override void addDependency(ExtensionDependency dependency); @Override List<ExtensionDependency> getDependencies(); @Override void setDependencies(Collection<? extends ExtensionDependency> dependencies); @Override void addManagedDependency(ExtensionDependency managedDependency); @Override List<ExtensionDependency> getManagedDependencies(); @Override void setManagedDependencies(Collection<? extends ExtensionDependency> managedDependencies); @Override ExtensionRepository getRepository(); @Override ExtensionScm getScm(); @Override void setScm(ExtensionScm scm); @Override ExtensionIssueManagement getIssueManagement(); @Override void setIssueManagement(ExtensionIssueManagement issueManagement); @Override ExtensionFile getFile(); @Override String getCategory(); @Override void setCategory(String categrory); @Override Collection<ExtensionRepositoryDescriptor> getRepositories(); @Override void setRepositories(Collection<? extends ExtensionRepositoryDescriptor> repositories); @Override void addRepository(ExtensionRepositoryDescriptor repository); @Override Map<String, Object> getProperties(); @Override T getProperty(String key); @Override T getProperty(String key, T def); @Override void putProperty(String key, Object value); @Override void setProperties(Map<String, Object> properties); @Override T removeProperty(String key); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(Extension o);  }
@Test void set() { AbstractExtension extension = toExtension("id", "version", new ExtensionId("feature", "featureversion")); extension.addAuthor(AUTHOR1); extension.addAuthor(AUTHOR2); extension.addRepository(DESCRIPTOR1); extension.addRepository(DESCRIPTOR2); extension.addLicense(LICENSE1); extension.addLicense(LICENSE2); extension.addDependency(DEPENDENCY1); extension.addDependency(DEPENDENCY2); extension.addManagedDependency(DEPENDENCY1); extension.addManagedDependency(DEPENDENCY2); extension.addAllowedNamespace("namespace1"); extension.addAllowedNamespace("namespace2"); AbstractExtension cloneExtension = new TestExtension(extension); assertEquals(extension, cloneExtension); assertEquals(extension.getId(), cloneExtension.getId()); assertEquals(new ArrayList<>(extension.getExtensionFeatures()), new ArrayList<>(cloneExtension.getExtensionFeatures())); assertEquals(Arrays.asList(DESCRIPTOR1, DESCRIPTOR2), cloneExtension.getRepositories()); assertEquals(Arrays.asList(AUTHOR1, AUTHOR2), cloneExtension.getAuthors()); assertEquals(Arrays.asList(LICENSE1, LICENSE2), cloneExtension.getLicenses()); assertEquals(Arrays.asList(DEPENDENCY1, DEPENDENCY2), cloneExtension.getDependencies()); assertEquals(Arrays.asList(DEPENDENCY1, DEPENDENCY2), cloneExtension.getManagedDependencies()); assertEquals(Arrays.asList("namespace1", "namespace2"), new ArrayList<>(cloneExtension.getAllowedNamespaces())); }