fix java exception assertion method