{
      boolean result = false;

      if (collection != null)
      {
        Collection<Object> mappedObjects = new HashSet<Object>();
        Collection<Object> mappingObjects = new HashSet<Object>();
        MappingRoot mappingRoot = mappingDomain.getMappingRoot();
    
        for (Object object : collection)
        {
          if (object instanceof Mapping)
          {
            appendIfCanExecute(NameMatchMappingCommand.create(mappingDomain, (Mapping)object));
            mappingObjects.add(object);
          }
          else if (mappingRoot.isInputObject(object) || mappingRoot.isOutputObject(object))
          {
            mappedObjects.add(object);
          }
        }

        if (!mappedObjects.isEmpty())
        {
          Collection<? extends Mapping> mappings = mappingRoot.getAllMappings(mappedObjects);
          switch (mappings.size())
          {
            case 0:
            {
              createMappingCommand = CreateMappingCommand.create(mappingDomain, mappedObjects);
              result = appendIfCanExecute(createMappingCommand);
              break;
            }
            case 1:
            {
              result = appendIfCanExecute(NameMatchMappingCommand.create(mappingDomain, mappings.iterator().next()));
              break;
            }
            default:
            {
              break;
            }
          }
        }
      }

      result = result || !isEmpty();
      return result;
    }