Unit Tests Setup

// JUnit4 Test Initialization

@BeforeClass
public static void setUpClass() {
  // Initialize stuff once for ALL tests (run once)
}

@Before
public void setUp() {
  // Initialize stuff before every test (this is run twice in this example)
}

@Test
public void test1() { /* Do assertions etc. */ }

@Test
public void test2() { /* Do assertions etc. */ }

@AfterClass
public static void tearDownClass() {
  // Do something after ALL tests have been run (run once)
}

@After
public void tearDown() {
  // Do something after each test (run twice in this example)
}