* @param type
* the new type
* @return true only if the new dependency can be added.
*/
public boolean changeType(Dependency dependency, DependencyType type) {
Dependency newDependency = dependency.createWithType(type);
boolean canAddDependency = diagramGraph.canAddDependency(newDependency);
if (canAddDependency) {
removeDependency(dependency);
addDependency(newDependency);
}