boolean (@NotNull PyCollectionType expected, @NotNull PyCollectionType actual, @NotNull MatchContext context) { if (expected.equals(actual)) { return true; } if (!expected.getPyClass().equals(actual.getPyClass())) { return false; } List<PyType> expectedElementTypes = expected.getElementTypes(); List<PyType> actualElementTypes = actual.getElementTypes(); if (context.reversedSubstitutions) { return matchTypeParameters(actualElementTypes, expectedElementTypes, context.resetSubstitutions()); } else { return matchTypeParameters(expectedElementTypes, actualElementTypes, context); } }