fix java solution