add many java solution