public static void trimRecordTemplate(RecordTemplate recordTemplate, MaskTree override, final boolean failOnMismatch)
  {
    trimRecordTemplate(recordTemplate.data(), recordTemplate.schema(), override, failOnMismatch);
  }
@Test
  public void testMapTrim() throws CloneNotSupportedException
  {
    TyperefTest test = new TyperefTest();

    RecordBarMap map = new RecordBarMap();
    RecordBar recordBar = new RecordBar();
    recordBar.setLocation("foo");
    map.put("map", recordBar);
    test.setBarRefMap(map);

    TyperefTest expected = test.copy();
    test.getBarRefMap().get("map").data().put("troublemaker", "data filth");

    Assert.assertEquals(recordBar.data().size(), 2);
    Assert.assertEquals(test.getBarRefMap().get("map").data().size(), 2);
    RestUtils.trimRecordTemplate(test, false);
    Assert.assertEquals(expected, test);
  }