refactored java tests