Improve use of JUnit for testing