[Java] Test format refactoring