void (@NotNull String expectedName, @NotNull List<String> expectedFieldsNames, @NotNull List<String> expectedFieldsTypes, @Nullable PyType type) { assertInstanceOf(type, PyTypedDictType.class); final PyTypedDictType typedDictType = (PyTypedDictType)type; assertEquals(expectedName, typedDictType.getName()); final Iterator<String> fieldsNamesIterator = expectedFieldsNames.iterator(); final Iterator<String> fieldsTypesIterator = expectedFieldsTypes.iterator(); for (Map.Entry<String, PyTypedDictType.FieldTypeAndTotality> entry : typedDictType.getFields().entrySet()) { assertTrue(fieldsNamesIterator.hasNext()); assertTrue(fieldsTypesIterator.hasNext()); final String fieldName = entry.getKey(); final PyTypedDictType.FieldTypeAndTotality fieldTypeAndTotality = entry.getValue(); assertEquals(fieldsNamesIterator.next(), fieldName); final PyType fieldType = fieldTypeAndTotality.getType(); assertEquals(fieldsTypesIterator.next(), fieldType == null ? null : fieldType.getName()); assertFalse(fieldTypeAndTotality.isRequired()); } assertFalse(fieldsNamesIterator.hasNext()); assertFalse(fieldsTypesIterator.hasNext()); }