public static InstanceStateMachine_c resolveInstance(
      ModelRoot modelRoot, java.util.UUID p_m_sm_id, java.util.UUID p_m_obj_id) {
    InstanceList instances = modelRoot.getInstanceList(InstanceStateMachine_c.class);
    InstanceStateMachine_c source = null;
    synchronized (instances) {
      Object[] key = {p_m_sm_id};
      source = (InstanceStateMachine_c) instances.get(key);
      if (source != null && !modelRoot.isCompareRoot()) {
        source.convertFromProxy();
        source.batchUnrelate();
        // pre-process the uuid so that we re-use null uuid instance rather then creating a new one.
        source.m_sm_id = IdAssigner.preprocessUUID(p_m_sm_id);
        // pre-process the uuid so that we re-use null uuid instance rather then creating a new one.
        source.m_obj_id = IdAssigner.preprocessUUID(p_m_obj_id);

        return source;
      }
    }
    // there is no instance matching the id
    InstanceStateMachine_c new_inst = new InstanceStateMachine_c(modelRoot, p_m_sm_id, p_m_obj_id);
    return new_inst;
  }