P119: Added Java solution.