Tagged articles

for-each

6 articles · Page 1 of 1
Dabaoshi
Dabaoshi
Aug 11, 2026 · Fundamentals

Why the Iterator Pattern Is the Most Used Yet Unnoticed Design Pattern in Java

The article explains how the Iterator pattern, built into Java as Iterable and Iterator interfaces, lets you traverse any collection uniformly without exposing its internal structure, demonstrates the fail‑fast mechanism, and shows when custom collections should implement Iterable.

CollectionDesign PatternIterable
0 likes · 13 min read
Why the Iterator Pattern Is the Most Used Yet Unnoticed Design Pattern in Java
Ops Development & AI Practice
Ops Development & AI Practice
Aug 28, 2025 · Cloud Computing

Master Terraform’s count Meta‑Argument: Bulk, Conditional, and Blue‑Green Deployments

This article explains Terraform’s count meta‑argument, showing how it transforms a single resource into a list for bulk creation, enables conditional provisioning with ternary expressions, illustrates blue‑green deployment switches, warns about index‑based pitfalls, and compares it with the more stable for_each alternative.

COUNTCloud AutomationIaC
0 likes · 9 min read
Master Terraform’s count Meta‑Argument: Bulk, Conditional, and Blue‑Green Deployments
Cognitive Technology Team
Cognitive Technology Team
Apr 4, 2022 · Fundamentals

Why Removing Elements from a HashMap During a For‑Each Loop Causes ConcurrentModificationException and How to Fix It

Iterating a HashMap with a for‑each loop while calling its remove method triggers a ConcurrentModificationException because the loop uses an internal iterator that becomes inconsistent with the map’s modCount, and the article explains the cause, shows decompiled code, and provides correct removal approaches using the iterator or removeIf.

ConcurrentModificationExceptionHashMapIterator
0 likes · 6 min read
Why Removing Elements from a HashMap During a For‑Each Loop Causes ConcurrentModificationException and How to Fix It