public static List<DataTypes.Field> getFields(DataType dataType) {
        final List<String> names = getFieldNames(dataType);
        final List<DataType> dataTypes = getFieldDataTypes(dataType);
        return IntStream.range(0, names.size())
                .mapToObj(i -> DataTypes.FIELD(names.get(i), dataTypes.get(i)))
                .collect(Collectors.toList());
    }
@Test
    void testGetFields() {
        assertThat(
                        DataType.getFields(
                                ROW(
                                        FIELD("c0", BOOLEAN()),
                                        FIELD("c1", DOUBLE()),
                                        FIELD("c2", INT()))))
                .containsExactly(FIELD("c0", BOOLEAN()), FIELD("c1", DOUBLE()), FIELD("c2", INT()));
        assertThat(
                        DataType.getFields(
                                STRUCTURED(
                                        DataTypesTest.SimplePojo.class,
                                        FIELD("name", STRING()),
                                        FIELD("count", INT().notNull().bridgedTo(int.class)))))
                .containsExactly(
                        FIELD("name", STRING()),
                        FIELD("count", INT().notNull().bridgedTo(int.class)));
        assertThat(DataType.getFields(ARRAY(INT()))).isEmpty();
        assertThat(DataType.getFields(INT())).isEmpty();
    }