AvroCoder extends CustomCoder<T> { public Schema getSchema() { return schemaSupplier.get(); } protected  AvroCoder(Class<T> type, Schema schema); static AvroCoder<T> of(TypeDescriptor<T> type); static AvroCoder<T> of(Class<T> clazz); static AvroGenericCoder of(Schema schema); static AvroCoder<T> of(Class<T> type, Schema schema); @SuppressWarnings("unused") static CoderProvider getCoderProvider(); Class<T> getType(); @Override void encode(T value, OutputStream outStream); @Override T decode(InputStream inStream); @Override void verifyDeterministic(); Schema getSchema(); @Override TypeDescriptor<T> getEncodedTypeDescriptor(); @Override boolean equals(@Nullable Object other); @Override int hashCode();  }
@Test public void testAvroProhibitsShadowing() { try { ReflectData.get().getSchema(SubclassHidingParent.class); fail("Expected AvroTypeException"); } catch (AvroRuntimeException e) { assertThat(e.getMessage(), containsString("mapField")); assertThat(e.getMessage(), containsString("two fields named")); } }