Mutator { public static Schema minusFields(Schema schema, String... minusFields) { return minusFields("minusSchema" + (COUNTER++), schema, minusFields); }  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 testMinus() { Schema schema = new Schema("a_schema", Fields.parse("a:int, b:int, c:double, e:string")); Schema mutated = Mutator.minusFields("mutated", schema, "b", "e"); assertEquals(new Schema("mutated", Fields.parse("a:int, c:double")), mutated); }