Code review comment: We should move the cases into the `types`. In line 225, we will create test cases with or without nullbility.

Code before review:
private static List<LogicalType> generateTestData() {
List<LogicalType> types =
Arrays.asList(
new BooleanType(),
new TinyIntType(),
new SmallIntType(),
new IntType(),
new BigIntType(),
new FloatType(),
new DoubleType(),
new DateType(),
CharType.ofEmptyLiteral(),
new CharType(),
new CharType(5),
VarCharType.ofEmptyLiteral(),
new VarCharType(),
new VarCharType(5),
BinaryType.ofEmptyLiteral(),
new BinaryType(),
new BinaryType(100),
VarBinaryType.ofEmptyLiteral(),
new VarBinaryType(),
new VarBinaryType(100),
new DecimalType(10),
new DecimalType(15, 5),
new TimeType(),
new TimeType(3),
new TimestampType(),
new TimestampType(3),
new TimestampType(false, 3),
new ZonedTimestampType(),
new ZonedTimestampType(3),
new LocalZonedTimestampType(),
new LocalZonedTimestampType(3),
new LocalZonedTimestampType(false, 3),
new LocalZonedTimestampType(false, TimestampKind.PROCTIME, 3),
new MapType(new BigIntType(), new IntType(false)),
new MapType(CharType.ofEmptyLiteral(), CharType.ofEmptyLiteral()),
new MapType(VarCharType.ofEmptyLiteral(), VarCharType.ofEmptyLiteral()),
new MapType(BinaryType.ofEmptyLiteral(), BinaryType.ofEmptyLiteral()),
new MapType(VarBinaryType.ofEmptyLiteral(), VarBinaryType.ofEmptyLiteral()),
new MapType(new TimestampType(false, 3), new LocalZonedTimestampType()),
new ArrayType(new IntType(false)),
new ArrayType(new TimestampType()),
new ArrayType(new LocalZonedTimestampType(false, 3)),
new ArrayType(CharType.ofEmptyLiteral()),
new ArrayType(VarCharType.ofEmptyLiteral()),
new ArrayType(BinaryType.ofEmptyLiteral()),
new ArrayType(VarBinaryType.ofEmptyLiteral()),
new MultisetType(new IntType(false)),
new MultisetType(new TimestampType()),
new MultisetType(new TimestampType(true, 3)),
new MultisetType(CharType.ofEmptyLiteral()),
new MultisetType(VarCharType.ofEmptyLiteral()),
new MultisetType(BinaryType.ofEmptyLiteral()),
new MultisetType(VarBinaryType.ofEmptyLiteral()),
RowType.of(new BigIntType(), new IntType(false), new VarCharType(200)),
RowType.of(
new LogicalType[] {
new BigIntType(), new IntType(false), new VarCharType(200)
},
new String[] {"f1", "f2", "f3"}),
RowType.of(
new TimestampType(false, 3), new LocalZonedTimestampType(false, 3)),
RowType.of(
CharType.ofEmptyLiteral(),
VarCharType.ofEmptyLiteral(),
BinaryType.ofEmptyLiteral(),
VarBinaryType.ofEmptyLiteral()),
new RowType(
Arrays.asList(
new RowType.RowField("ID", new BigIntType(), "ID desc"),
new RowType.RowField(
"Name", new VarCharType(20), "Name desc"))),
new RawType<>(LocalDateTime.class, LocalDateTimeSerializer.INSTANCE),
new RawType<>(
Row.class,
ExternalSerializer.of(
DataTypes.ROW(DataTypes.INT(), DataTypes.STRING()))));
List<LogicalType> testTypes =
Stream.concat(
types.stream().map(type -> type.copy(true)),
types.stream().map(type -> type.copy(false)))
.collect(Collectors.toList());
testTypes.add(new NullType());
testTypes.add(new YearMonthIntervalType(YearMonthIntervalType.YearMonthResolution.MONTH));
testTypes.add(
new YearMonthIntervalType(YearMonthIntervalType.YearMonthResolution.YEAR_TO_MONTH));
testTypes.add(new YearMonthIntervalType(YearMonthIntervalType.YearMonthResolution.YEAR));
testTypes.add(new DayTimeIntervalType(DayTimeIntervalType.DayTimeResolution.DAY));
testTypes.add(new DayTimeIntervalType(DayTimeIntervalType.DayTimeResolution.DAY_TO_HOUR));
testTypes.add(new DayTimeIntervalType(DayTimeIntervalType.DayTimeResolution.DAY_TO_MINUTE));
testTypes.add(new DayTimeIntervalType(DayTimeIntervalType.DayTimeResolution.DAY_TO_SECOND));
testTypes.add(new DayTimeIntervalType(DayTimeIntervalType.DayTimeResolution.HOUR));
testTypes.add(
new DayTimeIntervalType(DayTimeIntervalType.DayTimeResolution.HOUR_TO_MINUTE));
testTypes.add(
new DayTimeIntervalType(DayTimeIntervalType.DayTimeResolution.HOUR_TO_SECOND));
testTypes.add(new DayTimeIntervalType(DayTimeIntervalType.DayTimeResolution.MINUTE));
testTypes.add(
new DayTimeIntervalType(DayTimeIntervalType.DayTimeResolution.MINUTE_TO_SECOND));
testTypes.add(new DayTimeIntervalType(DayTimeIntervalType.DayTimeResolution.SECOND));
return testTypes;
}

Line under review: testTypes.add(new YearMonthIntervalType(YearMonthIntervalType.YearMonthResolution.MONTH));

Code after addressing the review:
private static List<LogicalType> generateTestData() {
List<LogicalType> types =
Arrays.asList(
new BooleanType(),
new TinyIntType(),
new SmallIntType(),
new IntType(),
new BigIntType(),
new FloatType(),
new DoubleType(),
new DateType(),
CharType.ofEmptyLiteral(),
new CharType(),
new CharType(5),
VarCharType.ofEmptyLiteral(),
new VarCharType(),
new VarCharType(5),
BinaryType.ofEmptyLiteral(),
new BinaryType(),
new BinaryType(100),
VarBinaryType.ofEmptyLiteral(),
new VarBinaryType(),
new VarBinaryType(100),
new DecimalType(10),
new DecimalType(15, 5),
new TimeType(),
new TimeType(3),
new TimestampType(),
new TimestampType(3),
new TimestampType(false, 3),
new ZonedTimestampType(),
new ZonedTimestampType(3),
new LocalZonedTimestampType(),
new LocalZonedTimestampType(3),
new LocalZonedTimestampType(false, 3),
new LocalZonedTimestampType(false, TimestampKind.PROCTIME, 3),
new MapType(new BigIntType(), new IntType(false)),
new MapType(CharType.ofEmptyLiteral(), CharType.ofEmptyLiteral()),
new MapType(VarCharType.ofEmptyLiteral(), VarCharType.ofEmptyLiteral()),
new MapType(BinaryType.ofEmptyLiteral(), BinaryType.ofEmptyLiteral()),
new MapType(VarBinaryType.ofEmptyLiteral(), VarBinaryType.ofEmptyLiteral()),
new MapType(new TimestampType(false, 3), new LocalZonedTimestampType()),
new ArrayType(new IntType(false)),
new ArrayType(new TimestampType()),
new ArrayType(new LocalZonedTimestampType(false, 3)),
new ArrayType(CharType.ofEmptyLiteral()),
new ArrayType(VarCharType.ofEmptyLiteral()),
new ArrayType(BinaryType.ofEmptyLiteral()),
new ArrayType(VarBinaryType.ofEmptyLiteral()),
new MultisetType(new IntType(false)),
new MultisetType(new TimestampType()),
new MultisetType(new TimestampType(true, 3)),
new MultisetType(CharType.ofEmptyLiteral()),
new MultisetType(VarCharType.ofEmptyLiteral()),
new MultisetType(BinaryType.ofEmptyLiteral()),
new MultisetType(VarBinaryType.ofEmptyLiteral()),
RowType.of(new BigIntType(), new IntType(false), new VarCharType(200)),
RowType.of(
new LogicalType[] {
new BigIntType(), new IntType(false), new VarCharType(200)
},
new String[] {"f1", "f2", "f3"}),
RowType.of(
new TimestampType(false, 3), new LocalZonedTimestampType(false, 3)),
RowType.of(
CharType.ofEmptyLiteral(),
VarCharType.ofEmptyLiteral(),
BinaryType.ofEmptyLiteral(),
VarBinaryType.ofEmptyLiteral()),
new RowType(
Arrays.asList(
new RowType.RowField("ID", new BigIntType(), "ID desc"),
new RowType.RowField(
"Name", new VarCharType(20), "Name desc"))),
new RawType<>(LocalDateTime.class, LocalDateTimeSerializer.INSTANCE),
new RawType<>(
Row.class,
ExternalSerializer.of(
DataTypes.ROW(DataTypes.INT(), DataTypes.STRING()))),
new YearMonthIntervalType(YearMonthIntervalType.YearMonthResolution.MONTH),
new YearMonthIntervalType(
YearMonthIntervalType.YearMonthResolution.YEAR_TO_MONTH),
new YearMonthIntervalType(YearMonthIntervalType.YearMonthResolution.YEAR),
new DayTimeIntervalType(DayTimeIntervalType.DayTimeResolution.DAY),
new DayTimeIntervalType(DayTimeIntervalType.DayTimeResolution.DAY_TO_HOUR),
new DayTimeIntervalType(
DayTimeIntervalType.DayTimeResolution.DAY_TO_MINUTE),
new DayTimeIntervalType(
DayTimeIntervalType.DayTimeResolution.DAY_TO_SECOND),
new DayTimeIntervalType(DayTimeIntervalType.DayTimeResolution.HOUR),
new DayTimeIntervalType(
DayTimeIntervalType.DayTimeResolution.HOUR_TO_MINUTE),
new DayTimeIntervalType(
DayTimeIntervalType.DayTimeResolution.HOUR_TO_SECOND),
new DayTimeIntervalType(DayTimeIntervalType.DayTimeResolution.MINUTE),
new DayTimeIntervalType(
DayTimeIntervalType.DayTimeResolution.MINUTE_TO_SECOND),
new DayTimeIntervalType(DayTimeIntervalType.DayTimeResolution.SECOND));
List<LogicalType> testTypes =
Stream.concat(
types.stream().map(type -> type.copy(true)),
types.stream().map(type -> type.copy(false)))
.collect(Collectors.toList());
testTypes.add(new NullType());
return testTypes;
}