GenericRecordBuilder implements Closeable { public Class<? extends GenericEnumSymbol> getEnumClass(final Schema schema) { Preconditions.checkArgument(SchemaUtils.isNamedType(schema), "schema %s has no java class", schema); try { return (Class<? extends GenericEnumSymbol>) source.loadClass(SchemaUtils.getJavaClassName(schema)); } catch (ClassNotFoundException ex) { throw new IllegalStateException(ex); } } GenericRecordBuilder(final Schema... schemas);  GenericRecordBuilder(final GenericData.StringType stringType, final Schema... schemas); Class<? extends SpecificRecordBase> getRecordClass(final Schema schema); Class<? extends GenericEnumSymbol> getEnumClass(final Schema schema); Class<? extends GenericFixed> getFixedClass(final Schema schema); @Override void close(); @Override String toString();  }
@Test public void testEnumImplementation() { Schema enumSchema = SchemaBuilder.enumeration("MyEnum").namespace("test").symbols("A", "B", "C"); try (GenericRecordBuilder builder = new GenericRecordBuilder(enumSchema)) { Class<? extends GenericEnumSymbol> enumClass = builder.getEnumClass(enumSchema); Assert.assertEquals("test.MyEnum", enumClass.getName()); } }