public void SetSize(long size) { if ((ulong)size!=GetSize()) throw new InvalidOperationException("For in memory collection SetSize should never be set to something else than GetSize"); }