P129: Added Java solution.