P95: Simplified Java solution.