/**
  * Return a dependency model matching the supplied descriptor. If no model matches the supplied
  * descriptor the implementation will return null.
  *
  * @param dependency the dependency descriptor
  * @return the matching stage model
  */
 public DependencyModel getDependencyModel(DependencyDescriptor dependency) {
   DependencyModel[] models = getDependencyModels();
   for (int i = 0; i < models.length; i++) {
     DependencyModel model = models[i];
     if (dependency.equals(model.getDependency())) {
       return model;
     }
   }
   return null;
 }
 private boolean isServiceAssembled() {
   DependencyModel[] dependencies = getDependencyModels();
   for (int i = 0; i < dependencies.length; i++) {
     DependencyModel dep = dependencies[i];
     if (null == dep.getProvider() && dep.getDependency().isRequired()) {
       return false;
     }
   }
   return true;
 }