public static void trimRecordTemplate(RecordTemplate recordTemplate, MaskTree override, final boolean failOnMismatch)
  {
    trimRecordTemplate(recordTemplate.data(), recordTemplate.schema(), override, failOnMismatch);
  }
@Test
  public void testOverrideMaskNestedRecord() throws CloneNotSupportedException
  {
    LinkedListNode node1 = new LinkedListNode();
    node1.setIntField(1);

    LinkedListNode node2 = new LinkedListNode();
    node2.setIntField(2);
    node1.setNext(node2);
    node2.data().put("keep me", "foo");

    MaskTree maskTree = new MaskTree();
    maskTree.addOperation(new PathSpec("next", "keep me"), MaskOperation.POSITIVE_MASK_OP);
    maskTree.addOperation(new PathSpec("next", "intField"), MaskOperation.POSITIVE_MASK_OP);

    LinkedListNode expected = node2.clone();
    RestUtils.trimRecordTemplate(node1, maskTree, false);
    Assert.assertEquals(node1.getNext(), expected);
  }