Rather than going overboard trying to second guess the userbase, have
interfaces like these ever been considered?
public interface VelocityMap
{
void set(Object key, Object value);
Object get(Object key);
VelocityIterator keys();
}
public interface VelocityIterator extends Iterator
{
void reset();
}
These cover the two basic kinds of access used by Velocity. VelocityMap is
simpler to implement than java.util.Map and VelocityIterator contains the
one piece of functionality lacking in the real Iterator.
Of course, this still won't be as convenient for debugging as being able to
toss Iterator and Enumeration directly into a #foreach, but it is simple,
consistent and easy to understand.