public static Action resolve(Schema writer, Schema reader, GenericData data) {
    return resolve(Schema.applyAliases(writer, reader), reader, data, new HashMap<>());
  }
@Test
  void resolveEnum() throws IOException {
    final Schema writeSchema = Schema.createEnum("myEnum", "", "n1", Arrays.asList("e1", "e3", "e4"));
    final Schema readSchema = Schema.createEnum("myEnum", "", "n1", Arrays.asList("e1", "e2", "e3"), "e2");

    Resolver.Action action = Resolver.resolve(writeSchema, readSchema);
    Assertions.assertNotNull(action);
    Assertions.assertEquals(action.type, Resolver.Action.Type.ENUM);
    MatcherAssert.assertThat("Wrong class for action", action, Matchers.instanceOf(Resolver.EnumAdjust.class));
    Resolver.EnumAdjust adjust = (Resolver.EnumAdjust) action;

    Assertions.assertArrayEquals(new int[] { 0, 2, 1 }, adjust.adjustments);
    Assertions.assertEquals("e1", adjust.values[0].toString());
    Assertions.assertEquals("e3", adjust.values[1].toString());
    Assertions.assertEquals("e2", adjust.values[2].toString());

    FastReaderBuilder reader = FastReaderBuilder.get();
    Schema writeRecord = Schema.createRecord("rec1", "", "", false,
        Arrays.asList(new Schema.Field("f1", writeSchema, "")));
    Schema readRecord = Schema.createRecord("rec1", "", "", false,
        Arrays.asList(new Schema.Field("f1", readSchema, "")));
    DatumReader<Object> datumReader = reader.createDatumReader(writeRecord, readRecord);
    JsonDecoder e2 = DecoderFactory.get().jsonDecoder(readRecord, "{ \"f1\" : \"e2\" }");
    Object read = datumReader.read(null, e2);
    Assertions.assertNotNull(read);
    MatcherAssert.assertThat("", read, Matchers.instanceOf(IndexedRecord.class));
    IndexedRecord result = (IndexedRecord) read;
    Assertions.assertEquals("e3", result.get(0).toString());
  }