void selectNext(Direction direction) {
      int currentLineY = myCurrentVariant.myStartPoint.y;
      VariantInfo next = switch (direction) {
        case LEFT -> getPreviousVariant();
        case RIGHT -> getNextVariant();
        case UP -> {
          int previousLineY = myVariants.stream().mapToInt(v -> v.myStartPoint.y).filter(v -> v < currentLineY).max().orElse(-1);
          yield myVariants.stream()
            .filter(v -> v.myStartPoint.y == previousLineY)
            .min(DISTANCE_TO_CURRENT_COMPARATOR)
            .orElseGet(this::getPreviousVariant);
        }
        case DOWN -> {
          int nextLineY = myVariants.stream().mapToInt(v -> v.myStartPoint.y).filter(v -> v > currentLineY).min().orElse(-1);
          yield myVariants.stream()
            .filter(v -> v.myStartPoint.y == nextLineY)
            .min(DISTANCE_TO_CURRENT_COMPARATOR)
            .orElseGet(this::getNextVariant);
        }
      };
      if (next != null) {
        select(next);
      }
    }
void selectNext(Direction direction)