static ItIt singletonIterator(A a) { ret new ItIt { bool returned; public A next() { if (!returned) ret a with returned = true; else fail(); } public bool hasNext() { ret !returned; } }; }