Use JUnit @Rules instead of inheritance in test cases