private void focusButton(boolean next) {
    List<JButton> buttons = new ArrayList<>(myButtonMap.values());
    int focusedIndex = ContainerUtil.indexOf(buttons, (Condition<? super Component>)Component::hasFocus);

    if (focusedIndex >= 0) {
      getEnabledIndexCyclic(buttons, focusedIndex, next).ifPresent(i -> buttons.get(i).requestFocus());
    }
  }
private void focusButton(boolean next)