private static void removeKeyStroke(@Nullable InputMap map, KeyStroke ks) {
    while (map != null) {
      map.remove(ks);
      map = map.getParent();
    }
  }
private static void removeKeyStroke(@Nullable InputMap map, KeyStroke ks)