[java] provide foldLeft method