final List<String> incompatabilityMessages = Lists.newArrayList();
for (Schema readerSchema : readerSchemas) {
// Check that each reader schema can read records written by all writer schemas.
final SchemaSetCompatibility compat =
AvroUtils.checkReaderCompatibility(readerSchema, writerSchemas.iterator());
if (compat.getType() == SchemaCompatibilityType.INCOMPATIBLE) {
for (SchemaPairCompatibility pairCompat : compat.getCauses()) {
if (pairCompat.getType() == SchemaCompatibilityType.INCOMPATIBLE) {
incompatabilityMessages.add(
String.format("Reader schema: %s is incompatible with writer schema: %s.",
pairCompat.getReader(), pairCompat.getWriter()));
}