HDFS-5673: validation and tests for removal of mask when it is required.