P86: Added Java solution.