void (@NotNull String name, @Nullable String extras, @NotNull List<PyRequirementRelation> relations, @NotNull List<PyPackageVersion> versions) { assertEquals(versions.size(), relations.size()); final StringBuilder sb = new StringBuilder(name); final List<PyRequirementVersionSpec> expectedVersionSpecs = new ArrayList<>(); if (extras != null) sb.append(extras); for (Pair<PyRequirementRelation, PyPackageVersion> pair : ContainerUtil.zip(relations, versions)) { final PyRequirementRelation relation = pair.getFirst(); final PyPackageVersion version = pair.getSecond(); expectedVersionSpecs.add(pyRequirementVersionSpec(relation, version)); } sb.append(StringUtil.join(expectedVersionSpecs, PyRequirementVersionSpec::getPresentableText, ",")); final String options = sb.toString(); if (extras == null) { assertEquals(new PyRequirementImpl(name, expectedVersionSpecs, singletonList(options), ""), fromLine(options)); } else { assertEquals(new PyRequirementImpl(name, expectedVersionSpecs, singletonList(options), StringUtil.trimLeading(extras)), fromLine(options)); } }