I have a HashMap:
HashMap
private HashMap example = new HashMap();
Now I would lik
Worth mentioning Java 8 approach, using BiConsumer and lambda functions:
BiConsumer consumer = (o1, o2) -> System.out.println(o1 + ", " + o2); example.forEach(consumer);
Assuming that you've overridden toString method of the two types if needed.
toString