Add recursive Java solution