<p>I have faced this problem quite often during the last couple of months, during which I've been building this system. The scenario is this: I have this kind of object that essentially is a list of other objects, but has some other properties specific of its nature. For example:</p>

<ul>
<li>Class <code>Tests</code>:

<ul>
<li>Contains many <code>Test</code> objects</li>
<li>Has properties:

<ul>
<li><code>DefaultTimeouts</code></li>
<li><code>DefaultNumberOfTries</code></li>
</ul></li>
</ul></li>
</ul>

<p>Should I have this class subclass <code>List&lt;Test&gt;</code> or should I have it inheriting from <code>Object</code>, simply having the list as a property beside the other fields?</p>

<p>I know that this may be a bit subjective and personal taste might play a role here, but I'd wholeheartedly like to know your opinion on this.</p>

If it literally does everything a
```
List
```
would do, and all the
```
List
```
functions would act on the
```
Tests
```
object in an intuitive way that gives the correct result, then in my opinion it should just subclass
```
List<Test>
```
.
Otherwise, you'll just have a class with a ton of methods which just call a method of the same name on the
```
List<Test>
```
variable in the instance. That'll just be an imperfect extension of the
```
List<Test>
```
class itself.