List<PyRequirementVersionSpec> (@Nullable String versionSpecs) { if (versionSpecs == null) return Collections.emptyList(); return StreamSupport .stream(StringUtil.tokenize(versionSpecs, ",").spliterator(), false) .map(String::trim) .map(PyRequirementParser::parseVersionSpec) .filter(req -> req != null) .collect(Collectors.toList()); }