@VisibleForTesting
  static List<String> collectColNamesFromSchema(Schema schema) {
    List<String> result = new ArrayList<>();
    Deque<String> visited = new LinkedList<>();
    collectColNamesFromAvroSchema(schema, visited, result);
    return result;
  }
@Test
  public void testCollectColumnNames() {
    Schema simpleSchema =  getSimpleSchema();
    List<String> fieldNames =  AvroInternalSchemaConverter.collectColNamesFromSchema(simpleSchema);
    List<String> expectedOutput = getSimpleSchemaExpectedColumnNames();
    assertEquals(expectedOutput.size(), fieldNames.size());
    assertTrue(fieldNames.containsAll(expectedOutput));


    Schema simpleSchemaWithNullable = getSimpleSchemaWithNullable();
    fieldNames =  AvroInternalSchemaConverter.collectColNamesFromSchema(simpleSchemaWithNullable);
    expectedOutput = getSimpleSchemaExpectedColumnNames();
    assertEquals(expectedOutput.size(), fieldNames.size());
    assertTrue(fieldNames.containsAll(expectedOutput));

    Schema complexSchemaSingleLevel = getComplexSchemaSingleLevel();
    fieldNames =  AvroInternalSchemaConverter.collectColNamesFromSchema(complexSchemaSingleLevel);
    expectedOutput = getComplexSchemaSingleLevelExpectedColumnNames();
    assertEquals(expectedOutput.size(), fieldNames.size());
    assertTrue(fieldNames.containsAll(expectedOutput));

    Schema deeplyNestedFieldSchema = getDeeplyNestedFieldSchema();
    fieldNames =  AvroInternalSchemaConverter.collectColNamesFromSchema(deeplyNestedFieldSchema);
    expectedOutput = getDeeplyNestedFieldSchemaExpectedColumnNames();
    assertEquals(expectedOutput.size(), fieldNames.size());
    assertTrue(fieldNames.containsAll(expectedOutput));
  }