void (@NotNull Component component, @NotNull ToIntFunction<? super JList<?>> indexFunc) { if (component instanceof JList<?> list) { int indexNew = indexFunc.applyAsInt(list); int indexOld = indexHolder.getAndSet(indexNew); if (indexNew != indexOld) onHover(list, indexNew); } }