Remove java 8 forEach so that the project does not require java 8