public static InstanceStateMachine_c InstanceStateMachineInstance(
     ModelRoot modelRoot, ClassQueryInterface_c test, boolean loadComponent) {
   InstanceStateMachine_c result =
       findInstanceStateMachineInstance(modelRoot, test, loadComponent);
   if (result == null && loadComponent) {
     List pmcs = PersistenceManager.findAllComponents(modelRoot, InstanceStateMachine_c.class);
     for (int i = 0; i < pmcs.size(); i++) {
       PersistableModelComponent component = (PersistableModelComponent) pmcs.get(i);
       if (!component.isLoaded()) {
         try {
           component.load(new NullProgressMonitor());
           result = findInstanceStateMachineInstance(modelRoot, test, loadComponent);
           if (result != null) return result;
         } catch (Exception e) {
           CorePlugin.logError("Error Loading component", e);
         }
       }
     }
   }
   if (result != null && loadComponent) {
     result.loadProxy();
   }
   return result;
 }