Java cookbook fixed