class Models {

	public static Specification clone(Specification specification) {
		Application<Task, Dependency> iApplication = clone(specification.getApplication());
		Architecture<Resource, Link> iArchitecture = clone(specification.getArchitecture());
		Mappings<Task, Resource> iMappings = new Mappings<Task, Resource>();
		Routings<Task, Resource, Link> iRoutings = new Routings<Task, Resource, Link>();

		for (Mapping<Task, Resource> m : specification.getMappings()) {
			iMappings.add(m);
		}

		Routings<Task, Resource, Link> sRoutings = specification.getRoutings();
		for (Task c : filterCommunications(specification.getApplication())) {
			Architecture<Resource, Link> sRouting = sRoutings.get(c);
			iRoutings.set(c, sRouting);
		}

		Specification clone = new Specification(iApplication, iArchitecture, iMappings, iRoutings);
		return clone;
	}

}