String (@NotNull List<String> versions) { if (!earlyReleasesAsUpgrades) { return StreamEx .of(versions) .findFirst( version -> { final PyPackageVersion normalized = PyPackageVersionNormalizer.normalize(version); return normalized == null || normalized.getPre() == null && normalized.getDev() == null; } ) .orElse(null); } return ContainerUtil.getFirstItem(versions); }