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