public static Byte extractAndPartitionTags(ExtendedCell cell, List<Tag> visTags,
    List<Tag> nonVisTags) {
    Byte serializationFormat = null;
    Iterator<Tag> tagsIterator = PrivateCellUtil.tagsIterator(cell);
    while (tagsIterator.hasNext()) {
      Tag tag = tagsIterator.next();
      if (tag.getType() == TagType.VISIBILITY_EXP_SERIALIZATION_FORMAT_TAG_TYPE) {
        serializationFormat = Tag.getValueAsByte(tag);
      } else if (tag.getType() == VISIBILITY_TAG_TYPE) {
        visTags.add(tag);
      } else {
        // ignore string encoded visibility expressions, will be added in replication handling
        nonVisTags.add(tag);
      }
    }
    return serializationFormat;
  }
Extracts and partitions the visibility tags and nonVisibility Tags
@param cell       - the cell for which we would extract and partition the visibility and non
                  visibility tags - all the visibilty tags of type TagType.VISIBILITY_TAG_TYPE
                  would be added to this list
@param nonVisTags - all the non visibility tags would be added to this list
@return - the serailization format of the tag. Can be null if no tags are found or if there is
        no visibility tag found
hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityUtils.java