PyRequirement (@NotNull Pair<String, String> nameAndVersion, @NotNull List<String> installOptions, @Nullable String extras) { final String name = nameAndVersion.getFirst(); final String version = nameAndVersion.getSecond(); if (version == null) { if (extras == null) { return new PyRequirementImpl(name, Collections.emptyList(), installOptions, ""); } else { return new PyRequirementImpl(name, Collections.emptyList(), installOptions, extras); } } final List<PyRequirementVersionSpec> versionSpecs = Collections.singletonList(PyRequirementsKt.pyRequirementVersionSpec( PyRequirementRelation.EQ, version)); if (extras == null) { return new PyRequirementImpl(name, versionSpecs, installOptions, ""); } else { return new PyRequirementImpl(name, versionSpecs, installOptions, extras); } }