Fix java unit test snippet