Find-out the last release version in a list of version (regarding Axway Conventions)

@param versions
@return String
@throws IncomparableException
767422
public String getLastRelease(final Collection<String> versions) {
        final List<Version> sorted = versions.stream()
                .filter(Version::isValid)               // filter invalid input values
                .map(Version::make)
                .filter(Optional::isPresent)
                .map(Optional::get)
                .filter(Version::isRelease)
                .sorted((v1, v2) -> {
                    try {
                        return v1.compare(v2);
                    } catch (IncomparableException e) {
                        return 0;
                    }
                })
                .collect(Collectors.toList());

        if(sorted.isEmpty()) {
            if(LOG.isWarnEnabled()) {
                LOG.warn(String.format("Cannot obtain last release from collection %s", versions.toString()));
            }
            return null;
        }

        return sorted.get(sorted.size() - 1).toString();
    }
1301005
public static function getByVersionNumber($version)
    {
        $updates = id(new Update())->getLocalAvailableUpdates();
        foreach ($updates as $up) {
            if ($up->getUpdateVersion() == $version) {
                return $up;
            }
        }
    }
250649
public function getHighestVersion(array $versions = []): string
    {
        $highest_version = 0;
        foreach ($versions as $version_number) {
            if ($version_number === 'dev-master') {
                continue;
            }
            if (str_replace('.', '', $version_number)+0 > $highest_version) {
                $highest_version = $version_number;
            }
        }
        if ($highest_version == 0) {
            return 'dev-master';
        }

        return $highest_version;
    }
774004
public static Version parseVersion(String version) {
		if (!Strings.isNullOrEmpty(version)) {
			try {
				return Version.parseVersion(version);
			} catch (Throwable exception) {
				//
			}
		}
		return null;
	}
352673
protected function getLastEditedAndStageForVersion($version)
    {
        // Cache key
        $baseTable = $this->baseTable();
        $id = $this->owner->ID;
        $key = "{$baseTable}#{$id}/{$version}";

        // Check cache
        if (isset($this->versionModifiedCache[$key])) {
            return $this->versionModifiedCache[$key];
        }

        // Build query
        $table = "\"{$baseTable}_Versions\"";
        $query = SQLSelect::create(['"LastEdited"', '"WasPublished"'], $table)
            ->addWhere([
                "{$table}.\"RecordID\"" => $id,
                "{$table}.\"Version\"" => $version
            ]);
        $result = $query->execute()->record();
        if (!$result) {
            return null;
        }
        $list = [
            $result['LastEdited'],
            $result['WasPublished'] ? static::LIVE : static::DRAFT,
        ];
        $this->versionModifiedCache[$key] = $list;
        return $list;
    }
1370720
def get_versioned_files(cls):
        """"""
        encoding = cls._get_terminal_encoding()
        output = run(['bzr', 'ls', '-VR'], encoding=encoding)
        return output.splitlines()
70246
def _get_available_versions(self):
        '''
        
        '''
        solvables = self.zypper.nolock.xml.call('se', '-xv', self.name).getElementsByTagName('solvable')
        if not solvables:
            raise CommandExecutionError('No packages found matching \'{0}\''.format(self.name))

        return sorted(set([slv.getAttribute(self._attr_solvable_version)
                           for slv in solvables if slv.getAttribute(self._attr_solvable_version)]))
208943
public void setVersions(java.util.Collection<String> versions) {
        if (versions == null) {
            this.versions = null;
            return;
        }

        this.versions = new com.amazonaws.internal.SdkInternalList<String>(versions);
    }
838977
public static function get_by_version($version) {
		$migrations = self::get_all();

		if (strpos($version, '/') === false) {
			$version = 'project/' . $version;
		}

		list($package, $version) = explode('/', $version);
		$migrations = \Skeleton\Database\Migration::get_between_versions($package);

		foreach ($migrations as $migration) {
			if (preg_match('@\\\\([\w]+)$@', get_class($migration), $matches)) {
				$classname = $matches[1];
			} else {
				$classname = get_class($migration);
			}
			if ($version == $classname) {
				return $migration;
			}

		}

		throw new \Exception('The specified version does not exists.');
	}
819628
public java.util.List<AssociationVersionInfo> getAssociationVersions() {
        if (associationVersions == null) {
            associationVersions = new com.amazonaws.internal.SdkInternalList<AssociationVersionInfo>();
        }
        return associationVersions;
    }
412486
public void setVersions(java.util.Collection<SecretVersionsListEntry> versions) {
        if (versions == null) {
            this.versions = null;
            return;
        }

        this.versions = new java.util.ArrayList<SecretVersionsListEntry>(versions);
    }
1033814
public function getSearchedVersions()
    {
        $versions = array();
        
        if (!empty($_REQUEST['Versions'])) {
            if (is_array($_REQUEST['Versions'])) {
                $versions = Convert::raw2att($_REQUEST['Versions']);
                $versions = array_combine($versions, $versions);
            } else {
                $version = Convert::raw2att($_REQUEST['Versions']);
                $versions[$version] = $version;
            }
        }

        return $versions;
    }
456052
public final void parseVersion(String version) {
        versionParts = new ArrayList<>();
        if (version != null) {
            final Pattern rx = Pattern.compile("(\\d+[a-z]{1,3}$|[a-z]+\\d+|\\d+|(release|beta|alpha)$)");
            final Matcher matcher = rx.matcher(version.toLowerCase());
            while (matcher.find()) {
                versionParts.add(matcher.group());
            }
            if (versionParts.isEmpty()) {
                versionParts.add(version);
            }
        }
    }
299416
private Path getVersionRoot(String version) throws VersionDoesNotExistException {

    try {
      return this.versions.get(version, new VersionRootLoader(version));
    } catch (ExecutionException e) {
      throw new RuntimeException(
          String.format("Error while checking if version \"%s\" for store \"%s\" exists", version, getStoreURI()), e);
    }
  }
37317
public static int getVersion(String version) {

        int ver = Integer.parseInt(version);
        return Math.abs(ver);
    }
365665
private function filterByLocalMajorVersion(array $versions)
    {
        list($localMajorVersion, ) = explode('.', $this->localVersion, 2);

        return array_filter($versions, function ($version) use ($localMajorVersion) {
            list($majorVersion, ) = explode('.', $version, 2);
            return $majorVersion === $localMajorVersion;
        });
    }
385979
public void setVersions(java.util.Collection<String> versions) {
        if (versions == null) {
            this.versions = null;
            return;
        }

        this.versions = new java.util.ArrayList<String>(versions);
    }