private static int getVersionPart(String[] parts, int index) {
    String part = index < parts.length ? parts[index] : "-4";
    return switch (part) {
      case SNAPSHOT -> 999;
      case ALPHA -> -3;
      case BETA -> -2;
      case RC -> -1;
      default -> {
        try {
          yield Integer.parseInt(part);
        }
        catch (NumberFormatException __) {
          yield -4;
        }
      }
    };
  }
private static int getVersionPart(String[] parts, int index)