JUnit tests refactoring