// 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/plugin/core/MechanicLog.java
// public class MechanicLog {
//   private static MechanicLog DEFAULT;
// 
//   private final ILog log;
// 
//   /**
//    * Get the default instance.
//    */
//   public synchronized static MechanicLog getDefault() {
//     if (DEFAULT == null) {
//       DEFAULT = new MechanicLog(MechanicPlugin.getDefault());
//     }
//     return DEFAULT;
//   }
// 
//   MechanicLog(Plugin plugin) {
//     this(plugin.getLog());
//   }
// 
//   public MechanicLog(ILog log) {
//     this.log = Preconditions.checkNotNull(log);
//   }
// 
//   /**
//    * Log a status.
//    */
//   public void log(IStatus status) {
//     log.log(status);
//   }
// 
//   /**
//    * Log an error to the Eclipse log.
//    *
//    * @param t the throwable.
//    * @param fmt string format
//    * @param args args that accompany the string format. If this is empty, fmt is assumed to be
//    * an unformatted string.
//    */
//   public void logError(Throwable t, String fmt, Object... args) {
//     String text = (args.length > 0) ? String.format(fmt, args) : fmt;
//     log(new Status(IStatus.ERROR, MechanicPlugin.PLUGIN_ID, text, t));
//   }
// 
//   /**
//    * Log an error to the Eclipse log, using the exception's message as the log message text.
//    *
//    * @param t the throwable.
//    */
//   public void logError(Throwable t) {
//     logError(t, t.getMessage());
//   }
// 
//   /**
//    * Log info to the Eclipse log.
//    *
//    * @param fmt string format
//    * @param args args that accompany the string format. If this is empty, fmt is assumed to be
//    * an unformatted string.
//    */
//   public void logInfo(String fmt, Object... args) {
//     log(IStatus.INFO, fmt, args);
//   }
// 
//   /**
//    * Log warning to the Eclipse log.
//    *
//    * @param fmt string format
//    * @param args args that accompany the string format. If this is empty, fmt is assumed to be
//    * an unformatted string.
//    */
//   public void logWarning(String fmt, Object... args) {
//     log(IStatus.WARNING, fmt, args);
//   }
// 
// 
//   /**
//    * Log a message to the Eclipse log.
//    *
//    * @param severity message severity. Reference {@link IStatus#getSeverity()}.
//    * @param fmt string format
//    * @param args args that accompany the string format. If this is empty, fmt is assumed to be
//    * an unformatted string.
//    */
//   public void log(int severity, String fmt, Object... args) {
//     String text = (args.length > 0) ? String.format(fmt, args) : fmt;
//     log(new Status(severity, MechanicPlugin.PLUGIN_ID, text));
//   }
// }


import com.google.common.base.Objects;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import com.google.eclipse.mechanic.core.keybinding.KbaChangeSet.Action;
import com.google.eclipse.mechanic.plugin.core.MechanicLog;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ParameterizedCommand;
import org.eclipse.jface.bindings.Binding;
import org.eclipse.jface.bindings.Scheme;
import org.eclipse.jface.bindings.keys.KeyBinding;
import org.eclipse.jface.bindings.keys.KeySequence;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
    return;
  }

  private static final Map<String, String> EMPTY_MAP = Collections.<String,String>emptyMap();

  static Map<String,String> commandParamMap(ParameterizedCommand command) {
    if (command == null) {
      return EMPTY_MAP;
    }
    @SuppressWarnings("unchecked")
    Map<String,String> result = ImmutableMap.copyOf(command.getParameterMap());
    return result == null ? EMPTY_MAP : result;
  }

  /**
   * Remove a binding.
   */
  public void removeBindingIfPresent(
      Scheme scheme,
      String platform,
      String contextId,
      KeySequence triggerSequence,
      Command command,
      Map<String, String> params) {

    Binding binding = find(scheme, platform, triggerSequence, command.getId(), params, userBindings);

    if (binding != null) {
      userBindings.remove(binding);
      removedBindings.add(binding);
// 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/plugin/core/MechanicLog.java
// public class MechanicLog {
//   private static MechanicLog DEFAULT;
// 
//   private final ILog log;
// 
//   /**
//    * Get the default instance.
//    */
//   public synchronized static MechanicLog getDefault() {
//     if (DEFAULT == null) {
//       DEFAULT = new MechanicLog(MechanicPlugin.getDefault());
//     }
//     return DEFAULT;
//   }
// 
//   MechanicLog(Plugin plugin) {
//     this(plugin.getLog());
//   }
// 
//   public MechanicLog(ILog log) {
//     this.log = Preconditions.checkNotNull(log);
//   }
// 
//   /**
//    * Log a status.
//    */
//   public void log(IStatus status) {
//     log.log(status);
//   }
// 
//   /**
//    * Log an error to the Eclipse log.
//    *
//    * @param t the throwable.
//    * @param fmt string format
//    * @param args args that accompany the string format. If this is empty, fmt is assumed to be
//    * an unformatted string.
//    */
//   public void logError(Throwable t, String fmt, Object... args) {
//     String text = (args.length > 0) ? String.format(fmt, args) : fmt;
//     log(new Status(IStatus.ERROR, MechanicPlugin.PLUGIN_ID, text, t));
//   }
// 
//   /**
//    * Log an error to the Eclipse log, using the exception's message as the log message text.
//    *
//    * @param t the throwable.
//    */
//   public void logError(Throwable t) {
//     logError(t, t.getMessage());
//   }
// 
//   /**
//    * Log info to the Eclipse log.
//    *
//    * @param fmt string format
//    * @param args args that accompany the string format. If this is empty, fmt is assumed to be
//    * an unformatted string.
//    */
//   public void logInfo(String fmt, Object... args) {
//     log(IStatus.INFO, fmt, args);
//   }
// 
//   /**
//    * Log warning to the Eclipse log.
//    *
//    * @param fmt string format
//    * @param args args that accompany the string format. If this is empty, fmt is assumed to be
//    * an unformatted string.
//    */
//   public void logWarning(String fmt, Object... args) {
//     log(IStatus.WARNING, fmt, args);
//   }
// 
// 
//   /**
//    * Log a message to the Eclipse log.
//    *
//    * @param severity message severity. Reference {@link IStatus#getSeverity()}.
//    * @param fmt string format
//    * @param args args that accompany the string format. If this is empty, fmt is assumed to be
//    * an unformatted string.
//    */
//   public void log(int severity, String fmt, Object... args) {
//     String text = (args.length > 0) ? String.format(fmt, args) : fmt;
//     log(new Status(severity, MechanicPlugin.PLUGIN_ID, text));
//   }
// }


// Path: parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/core/keybinding/KeyBindings.java
import com.google.common.base.Objects;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import com.google.eclipse.mechanic.core.keybinding.KbaChangeSet.Action;
import com.google.eclipse.mechanic.plugin.core.MechanicLog;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ParameterizedCommand;
import org.eclipse.jface.bindings.Binding;
import org.eclipse.jface.bindings.Scheme;
import org.eclipse.jface.bindings.keys.KeyBinding;
import org.eclipse.jface.bindings.keys.KeySequence;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;

    return;
  }

  private static final Map<String, String> EMPTY_MAP = Collections.<String,String>emptyMap();

  static Map<String,String> commandParamMap(ParameterizedCommand command) {
    if (command == null) {
      return EMPTY_MAP;
    }
    @SuppressWarnings("unchecked")
    Map<String,String> result = ImmutableMap.copyOf(command.getParameterMap());
    return result == null ? EMPTY_MAP : result;
  }

  /**
   * Remove a binding.
   */
  public void removeBindingIfPresent(
      Scheme scheme,
      String platform,
      String contextId,
      KeySequence triggerSequence,
      Command command,
      Map<String, String> params) {

    Binding binding = find(scheme, platform, triggerSequence, command.getId(), params, userBindings);

    if (binding != null) {
      userBindings.remove(binding);
      removedBindings.add(binding);
      return;