Fix java tests