Sometimes the setup can be more complex than you want to put in a constructor or a field initializer
Sometimes you want to reinitialize static data
Sometimes you just want to share setup code between different methods.
setUp
method is run before each test:
protected void setUp() {
list = new LinkedList();
super.setUp();
}
setUp()
should call super.setUp()