change source code to Java 1.8 + refactor foreach to lambda foreach