anchor.diff:    Result := System.TypeInfo(T);
   end;
   
  +
   class function TSet<T>.IsSet: Boolean;
   begin
     Result := TypeInfo.Kind = tkSet;
   end;
   
  -function GetCardinality(const PSet: PByteArray; const SizeOfSet(*in bytes*): Integer): Integer; inline;
  +
  +class function TSet<T>.GetCardinality(const PSet: PByteArray; const SizeOfSet(*in bytes*): Integer): Integer;
   var
     I, J: Integer;
   begin
     Result := 0;
     for I := 0 to SizeOfSet - 1 do
       for J := 0 to 7 do
  -      if (PSet^[I] and Masks[J]) > 0 then
  +      if (PSet^[I] and BIT_MASKS[J]) > 0 then
           Inc(Result);
   end;
   
  
positive.code:   end;
  
  
    function GetCardinality(const PSet: PByteArray; const SizeOfSet(*in bytes*): Integer): Integer; inline;
  
  
  const
    Masks: array[0..7] of Byte = (1, 2, 4, 8, 16, 32, 64, 128);
  
  implementation
  uses
    KM_CommonUtils;
  
negative.code: 
    for I := 0 to SizeOfSet - 1 do
      for J := 0 to 7 do
        if (PSet^[I] and BIT_MASKS[J]) > 0 then
        begin
          if Result <> '' then
            Result := Result + ', ';
  