KeyBindingDispatcher implements KeyEventDispatcher { public void bind(KeyStroke keyStroke, Action action, Object key) { Contract.asNotNull(key, "binding key must not be null"); put(keyStroke, key); put(key, action); }  @Override boolean dispatchKeyEvent(KeyEvent e); void bind(KeyStroke keyStroke, Action action, Object key); ActionMap getActionMap(); InputMap getInputMap(); void bind(KeyStroke keyStroke, Action action); void put(KeyStroke keyStroke, Object actionMapKey); Object get(KeyStroke keyStroke); void put(Object key, Action action); Action get(Object key);  }
@Test(expected= NullPointerException.class) public void testBindKeyStrokeActionNullKey() { dispatcher.bind(enter, action, null); }