public static @Nullable Action getAction(@Nullable String id, @Nullable JComponent component) {
    if (id == null || component == null) return null;
    ActionMap map = component.getActionMap();
    return map == null ? null : map.get(id);
  }
public static @Nullable Action getAction(@Nullable String id, @Nullable JComponent component)