static @Nullable TextWithIcon getTextWithIcon(@Nullable ListCellRenderer<Object> renderer, Object element) {
    if (renderer == null) {
      return null;
    }
    Component component = renderer.getListCellRendererComponent(new JList<>(), element, -1, false, false);
    if (!(component instanceof JLabel label)) {
      return null;
    }
    return new TextWithIcon(label.getText(), label.getIcon());
  }
static @Nullable TextWithIcon getTextWithIcon(@Nullable ListCellRenderer<Object> renderer, Object element)