Mutator { public static Schema jointSchema(Schema leftSchema, Schema rightSchema) { return jointSchema("jointSchema" + (COUNTER++), leftSchema, rightSchema); }  static Schema minusFields(Schema schema, String... minusFields); static Schema minusFields(String newName, Schema schema, String... minusFields); static Schema subSetOf(Schema schema, String... subSetFields); static Schema subSetOf(String newName, Schema schema, String... subSetFields); static Schema superSetOf(Schema schema, Field... newFields); static Schema superSetOf(String newName, Schema schema, Field... newFields); static Schema jointSchema(Schema leftSchema, Schema rightSchema); static Schema jointSchema(String newName, Schema leftSchema, Schema rightSchema); static int COUNTER; }
@Test public void testJoint() { Schema schema1 = new Schema("a_schema", Fields.parse("a:int, b:int, c:double, e:string")); Schema schema2 = new Schema("a_schema", Fields.parse("b:int, f:double, h:string")); Schema mutated = Mutator.jointSchema("mutated", schema1, schema2); assertEquals(new Schema("mutated", Fields.parse("a:int, b:int, c:double, e:string, f:double, h:string")), mutated); }