SchemaZipFold implements Serializable { public final T apply(Schema left, Schema right) { return visit(this, Context.EMPTY, FieldType.row(left), FieldType.row(right)); }  final T apply(Schema left, Schema right); abstract T accumulate(T left, T right); abstract T accept(Context context, FieldType left, FieldType right); abstract T accept(Context context, Optional<Field> left, Optional<Field> right);  }
@Test public void testCountCommonLeafs() { assertEquals(3, new CountCommonLeafs().apply(LEFT, RIGHT).intValue()); }
@Test public void testCountCommonFields() { assertEquals(6, new CountCommonFields().apply(LEFT, RIGHT).intValue()); }
@Test public void testCountMissingFields() { assertEquals(4, new CountMissingFields().apply(LEFT, RIGHT).intValue()); }
@Test public void testListCommonFields() { assertThat( new ListCommonFields().apply(LEFT, RIGHT), containsInAnyOrder("f0", "f1", "f2", "f3", "f3.f0", "f3.f1")); }