String (@NotNull String expectedTypeList, @NotNull String actualTypeList) { Set<String> allTypeVarName = new LinkedHashSet<>(); allTypeVarName.addAll(StringUtil.findMatches(expectedTypeList, TYPE_VAR_NAME, 0)); allTypeVarName.addAll(StringUtil.findMatches(actualTypeList, TYPE_VAR_NAME, 0)); Set<String> allTypeVarTupleName = new LinkedHashSet<>(); allTypeVarTupleName.addAll(StringUtil.findMatches(expectedTypeList, TYPE_VAR_TUPLE_NAME, 0)); allTypeVarTupleName.addAll(StringUtil.findMatches(actualTypeList, TYPE_VAR_TUPLE_NAME, 0)); StringBuilder testData = new StringBuilder( """ from typing import TypeVar, TypeVarTuple """); for (String typeVarName : allTypeVarName) { testData.append(typeVarName).append(" = TypeVar('").append(typeVarName).append("')\n"); } for (String typeVarTupleName : allTypeVarTupleName) { testData.append(typeVarTupleName).append(" = TypeVarTuple('").append(typeVarTupleName).append("')\n"); } return testData.toString(); }