private ObjectAction getAction(
     final List<ObjectAction> availableActions, final ActionType type, final String id) {
   if (id == null) {
     return null;
   }
   outer:
   for (int i = 0; i < availableActions.size(); i++) {
     final ObjectAction action = availableActions.get(i);
     if (action.getActions().size() > 0) {
       // deal with action set
       final ObjectAction a = getAction(action.getActions(), type, id);
       if (a != null) {
         return a;
       }
     } else {
       // regular action
       if (!type.matchesTypeOf(action)) {
         continue outer;
       }
       if (id.equals(action.getIdentifier().toNameParmsIdentityString())) {
         return action;
       }
       if (id.equals(action.getIdentifier().toNameIdentityString())) {
         return action;
       }
       continue outer;
     }
   }
   return null;
 }
 private ObjectAction getAction(
     final List<ObjectAction> availableActions,
     final ActionType type,
     final String actionName,
     final List<ObjectSpecification> parameters) {
   outer:
   for (int i = 0; i < availableActions.size(); i++) {
     final ObjectAction action = availableActions.get(i);
     if (action.getActions().size() > 0) {
       // deal with action set
       final ObjectAction a = getAction(action.getActions(), type, actionName, parameters);
       if (a != null) {
         return a;
       }
     } else {
       // regular action
       if (!action.getType().equals(type)) {
         continue outer;
       }
       if (actionName != null && !actionName.equals(action.getId())) {
         continue outer;
       }
       if (action.getParameters().size() != parameters.size()) {
         continue outer;
       }
       for (int j = 0; j < parameters.size(); j++) {
         if (!parameters.get(j).isOfType(action.getParameters().get(j).getSpecification())) {
           continue outer;
         }
       }
       return action;
     }
   }
   return null;
 }