2 using SCG
= System
.Collections
.Generic
;
4 public interface IExtensible
<T
>
6 void AddAll
<U
> (SCG
.IEnumerable
<U
> items
)
10 public abstract class CollectionValueTester
<R
,S
>
11 where R
: IExtensible
<S
>
13 protected R collection
;
16 public class ExtensibleTester
<U
> : CollectionValueTester
<U
,int>
17 where U
: IExtensible
<int>
19 public ExtensibleTester (U u
)
26 collection
.AddAll
<int> (new int[] { }
);
30 public class Extensible
<V
> : IExtensible
<V
>
32 public void AddAll
<W
> (SCG
.IEnumerable
<W
> items
)
39 public static void Main ()
41 Extensible
<int> ext
= new Extensible
<int> ();
42 ExtensibleTester
<Extensible
<int>> tester
= new ExtensibleTester
<Extensible
<int>> (ext
);