### Question:
GenericData { public Object createEnum(String symbol, Schema schema) { return new EnumSymbol(schema, symbol); } GenericData();  GenericData(ClassLoader classLoader); static void setStringType(Schema s, StringType stringType); static GenericData get(); ClassLoader getClassLoader(); Collection<Conversion<?>> getConversions(); void addLogicalTypeConversion(Conversion<?> conversion); @SuppressWarnings("unchecked") Conversion<T> getConversionByClass(Class<T> datumClass); @SuppressWarnings("unchecked") Conversion<T> getConversionByClass(Class<T> datumClass, LogicalType logicalType); @SuppressWarnings("unchecked") Conversion<Object> getConversionFor(LogicalType logicalType); GenericData setFastReaderEnabled(boolean flag); boolean isFastReaderEnabled(); FastReaderBuilder getFastReaderBuilder(); DatumReader createDatumReader(Schema schema); DatumReader createDatumReader(Schema writer, Schema reader); DatumWriter createDatumWriter(Schema schema); boolean validate(Schema schema, Object datum); String toString(Object datum); Schema induce(Object datum); void setField(Object record, String name, int position, Object value); Object getField(Object record, String name, int position); int resolveUnion(Schema union, Object datum); int hashCode(Object o, Schema s); int compare(Object o1, Object o2, Schema s); @SuppressWarnings({ "unchecked" }) Object getDefaultValue(Field field); @SuppressWarnings({ "rawtypes", "unchecked" }) T deepCopy(Schema schema, T value); Object createFixed(Object old, Schema schema); Object createFixed(Object old, byte[] bytes, Schema schema); Object createEnum(String symbol, Schema schema); Object newRecord(Object old, Schema schema); Object createString(Object value); Object newArray(Object old, int size, Schema schema); Object newMap(Object old, int size); InstanceSupplier getNewRecordSupplier(Schema schema); static final String STRING_PROP; static final String FAST_READER_PROP; }### Answer:
@Test public void testEnumCompare() { Schema s = Schema.createEnum("Kind", null, null, Arrays.asList("Z", "Y", "X")); GenericEnumSymbol z = new GenericData.EnumSymbol(s, "Z"); GenericEnumSymbol z2 = new GenericData.EnumSymbol(s, "Z"); assertEquals(0, z.compareTo(z2)); GenericEnumSymbol y = new GenericData.EnumSymbol(s, "Y"); assertTrue(y.compareTo(z) > 0); assertTrue(z.compareTo(y) < 0); }