{"author_url":"https://blog.hatena.ne.jp/taichiw/","image_url":null,"description":"Collection shouldn't be updated in lambda explanation Sometimes I see these kind of code. List<X> list = new ArrayList<>(); /*AnyCollection*/.forEach() .map(t -> list.add(t.getXXXX()));I think it's bad code. It's not thread safe If you use parallel stream on above code... List<X> list = new ArrayLis\u2026","title":"You should avoid using forEach on Java as much as possible, I think","categories":[],"url":"https://taichiw-e.hatenablog.com/entry/2019/02/15/172907","published":"2019-02-15 17:29:07","height":"190","width":"100%","blog_title":"I write Engineering Topic weekly...?","provider_name":"Hatena Blog","type":"rich","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftaichiw-e.hatenablog.com%2Fentry%2F2019%2F02%2F15%2F172907\" title=\"You should avoid using forEach on Java as much as possible, I think - I write Engineering Topic weekly...?\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_name":"taichiw","blog_url":"https://taichiw-e.hatenablog.com/","version":"1.0","provider_url":"https://hatena.blog"}