Component (JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { //noinspection unchecked Component component = myContext.getRenderer().getListCellRendererComponent(list, (T)value, index, isSelected, cellHasFocus); if (component instanceof JComponent jComponent && !(component instanceof JSeparator || component instanceof TitledSeparator)) { if (!(component instanceof GroupedElementsRenderer.MyComponent)) { jComponent.setBorder(COMBO_ITEM_BORDER); } myContext.customizeListRendererComponent(jComponent); } return component; }