handle java variance