public static DataSchema buildSchemaByProjection(DataSchema schema, DataMap maskMap)
  {
    return buildSchemaByProjection(schema, maskMap, Collections.emptyList());
  }
@Test
  public void testBuildSchemaByProjectionAllowWhitelistedFields()
  {
    final String whiteListedFieldName = "$URN";
    RecordDataSchema schema = (RecordDataSchema) DataTemplateUtil.getSchema(RecordTemplateWithComplexKey.class);
    DataMap projectionMask = buildProjectionMaskDataMap("body", whiteListedFieldName);
    DataMap nestedMask = buildProjectionMaskDataMap("a", whiteListedFieldName);
    projectionMask.put("id", nestedMask);

    RecordDataSchema validatingSchema = (RecordDataSchema) buildSchemaByProjection(schema, projectionMask,
        Lists.newArrayList(whiteListedFieldName));
    Assert.assertTrue(validatingSchema.contains("id"));
    Assert.assertTrue(validatingSchema.contains("body"));
    Assert.assertFalse(validatingSchema.contains(whiteListedFieldName));
    Assert.assertTrue(((RecordDataSchema) validatingSchema.getField("id").getType()).contains("a"));
    Assert.assertFalse(((RecordDataSchema) validatingSchema.getField("id").getType()).contains(whiteListedFieldName));
  }