private void assertEquals(Type expected, Type actual) {
    if (actual.isPrimitiveType()) {
      assertThat(actual).isEqualTo(expected);
    } else {
      List<Types.NestedField> expectedFields = ((Type.NestedType) expected).fields();
      List<Types.NestedField> actualFields = ((Type.NestedType) actual).fields();
      for (int i = 0; i < expectedFields.size(); ++i) {
        assertEquals(expectedFields.get(i).type(), actualFields.get(i).type());
        assertThat(actualFields.get(i).name()).isEqualTo(expectedFields.get(i).name());
      }
    }
  }
Compares the nested types without checking the ids.
@param expected The expected types to compare
@param actual The actual types to compare
iceberg/iceberg-catalog/src/test/java/org/apache/iceberg/hive/TestHiveSchemaUtil.java