@Test
  public void testKeyStrokes() {
    final KeyStroke lKeyStroke = KeyStroke.getInstance(SWT.MOD1, 'I');
    assertEquals(SWT.MOD1 | 'I', lKeyStroke.getModifierKeys() | lKeyStroke.getNaturalKey());
    assertEquals("CTRL+I", lKeyStroke.format());

    final KeySequence lSequence = KeySequence.getInstance(lKeyStroke);

    assertEquals("CTRL+I", lSequence.format());
    assertEquals(SWT.MOD1 | 'I', getKeyCode(lSequence));
  }
  public final void testBindingTransform() throws Exception {
    ICommandService commandService = (ICommandService) fWorkbench.getAdapter(ICommandService.class);
    IBindingService bindingService = (IBindingService) fWorkbench.getAdapter(IBindingService.class);

    ParameterizedCommand addWS =
        new ParameterizedCommand(
            commandService.getCommand("org.eclipse.ui.navigate.addToWorkingSet"), null);
    KeySequence m18w = KeySequence.getInstance("M1+8 W");
    KeySequence m28w = KeySequence.getInstance("M2+8 W");
    boolean foundDeleteMarker = false;
    int numOfMarkers = 0;
    Binding[] bindings = bindingService.getBindings();
    for (int i = 0; i < bindings.length; i++) {
      final Binding binding = bindings[i];
      if (binding.getType() == Binding.SYSTEM) {
        String platform = binding.getPlatform();
        int idx = (platform == null ? -1 : platform.indexOf(','));
        assertEquals(binding.toString(), -1, idx);
        if (addWS.equals(binding.getParameterizedCommand())) {
          if (m18w.equals(binding.getTriggerSequence())) {
            numOfMarkers++;
            assertNull(m18w.format(), binding.getPlatform());
          } else if (m28w.equals(binding.getTriggerSequence())) {
            numOfMarkers++;
            assertTrue(
                platform,
                Util.WS_CARBON.equals(platform)
                    || Util.WS_COCOA.equals(platform)
                    || Util.WS_GTK.equals(platform)
                    || Util.WS_WIN32.equals(platform));
          }
        } else if (binding.getParameterizedCommand() == null
            && m18w.equals(binding.getTriggerSequence())) {
          assertTrue(
              platform,
              Util.WS_CARBON.equals(platform)
                  || Util.WS_COCOA.equals(platform)
                  || Util.WS_GTK.equals(platform)
                  || Util.WS_WIN32.equals(platform));
          numOfMarkers++;
          foundDeleteMarker = true;
        }
      }
    }
    assertEquals(3, numOfMarkers);
    assertTrue("Unable to find delete marker", foundDeleteMarker);
    TriggerSequence[] activeBindingsFor = bindingService.getActiveBindingsFor(addWS);
    assertEquals(1, activeBindingsFor.length);
  }