// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java
// enum Action {
//   ADD("add"),
//   REMOVE("remove"),
//   ;
// 
//   /**
//    * Label as it appears in the .kbd JSON file
//    */
//   private final String label;
// 
//   Action(String label) {
//     this.label = label;
//   }
// 
//   public static Action fromLabel(String someLabel) {
//     for (Action a : values()) {
//       if (a.label.equals(someLabel))
//         return a;
//     }
//     throw new IllegalArgumentException(String.format(
//         "'%s' is not a valid action",
//         someLabel));
//   }
// 
//   static Action forLabel(String label) {
//     for (Action action : values()) {
//       if (action.label.equals(label)) {
//         return action;
//       }
//     }
//     throw new IllegalArgumentException(label);
//   }
//     
//   @Override
//   public String toString() {
//     return label;
//   }
// }
// 
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KeyBindingsManualFormatter.java
// enum BindingType {
//   USER,
//   SYSTEM,
//   ;
//     
//   static BindingType from(Binding binding) {
//     return from(binding.getType());
//   }
//     
//   static BindingType from(int eclipseBindingType) {
//     if (eclipseBindingType == Binding.SYSTEM) {
//       return SYSTEM;
//     } else if (eclipseBindingType == Binding.USER) {
//       return USER;
//     } else {
//       throw new UnsupportedOperationException("Binding type: " + eclipseBindingType);
//     }
//   }
//     
// }


import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.collect.Iterables;
import com.google.eclipse.mechanic.core.keybinding.KbaChangeSet.Action;
import com.google.eclipse.mechanic.core.keybinding.KeyBindingsManualFormatter.BindingType;
import org.eclipse.core.commands.ParameterizedCommand;
import org.eclipse.jface.bindings.Binding;
import java.util.Map;
    if (!(obj instanceof EclBinding)) {
      return false;
    }
    EclBinding that = (EclBinding)obj;
    return Objects.equal(this.cid, that.cid)
        && Objects.equal(this.contextId, that.contextId)
        && Objects.equal(this.keySequence, that.keySequence)
        && Objects.equal(this.paramMap, that.paramMap)
        && Objects.equal(this.platform, that.platform)
        && Objects.equal(this.schemeId, that.schemeId)
        && Objects.equal(this.type, that.type);
  }

  @Override
  public int hashCode() {
    return Objects.hashCode(this.cid,
        this.contextId,
        this.keySequence,
        this.paramMap,
        this.platform,
        this.schemeId,
        this.type);
  }
  
  private static final Function<Binding, EclBinding> TRANSFORM = new Function<Binding, EclBinding>() {
    public EclBinding apply(Binding b) {
      return new EclBinding(b);
    }
  };

// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KbaChangeSet.java
// enum Action {
//   ADD("add"),
//   REMOVE("remove"),
//   ;
// 
//   /**
//    * Label as it appears in the .kbd JSON file
//    */
//   private final String label;
// 
//   Action(String label) {
//     this.label = label;
//   }
// 
//   public static Action fromLabel(String someLabel) {
//     for (Action a : values()) {
//       if (a.label.equals(someLabel))
//         return a;
//     }
//     throw new IllegalArgumentException(String.format(
//         "'%s' is not a valid action",
//         someLabel));
//   }
// 
//   static Action forLabel(String label) {
//     for (Action action : values()) {
//       if (action.label.equals(label)) {
//         return action;
//       }
//     }
//     throw new IllegalArgumentException(label);
//   }
//     
//   @Override
//   public String toString() {
//     return label;
//   }
// }
// 
// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KeyBindingsManualFormatter.java
// enum BindingType {
//   USER,
//   SYSTEM,
//   ;
//     
//   static BindingType from(Binding binding) {
//     return from(binding.getType());
//   }
//     
//   static BindingType from(int eclipseBindingType) {
//     if (eclipseBindingType == Binding.SYSTEM) {
//       return SYSTEM;
//     } else if (eclipseBindingType == Binding.USER) {
//       return USER;
//     } else {
//       throw new UnsupportedOperationException("Binding type: " + eclipseBindingType);
//     }
//   }
//     
// }


// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/EclBinding.java
import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.collect.Iterables;
import com.google.eclipse.mechanic.core.keybinding.KbaChangeSet.Action;
import com.google.eclipse.mechanic.core.keybinding.KeyBindingsManualFormatter.BindingType;
import org.eclipse.core.commands.ParameterizedCommand;
import org.eclipse.jface.bindings.Binding;
import java.util.Map;

    if (!(obj instanceof EclBinding)) {
      return false;
    }
    EclBinding that = (EclBinding)obj;
    return Objects.equal(this.cid, that.cid)
        && Objects.equal(this.contextId, that.contextId)
        && Objects.equal(this.keySequence, that.keySequence)
        && Objects.equal(this.paramMap, that.paramMap)
        && Objects.equal(this.platform, that.platform)
        && Objects.equal(this.schemeId, that.schemeId)
        && Objects.equal(this.type, that.type);
  }

  @Override
  public int hashCode() {
    return Objects.hashCode(this.cid,
        this.contextId,
        this.keySequence,
        this.paramMap,
        this.platform,
        this.schemeId,
        this.type);
  }
  
  private static final Function<Binding, EclBinding> TRANSFORM = new Function<Binding, EclBinding>() {
    public EclBinding apply(Binding b) {
      return new EclBinding(b);
    }
  };

  public KbaChangeSetQualifier with(Action action) {