Recently I've been doing a lot of these
enum Thing {
/* etc etc */
static final Set<Thing> allThings = EnumSet.allOf(Thing.class);
}
I want something similar in pre 1.5 Java, i.e. I want something like:
final class Thing {
private Thing(); // control instances within class
static final Thing instance0 = new Thing();
static final Thing instance1 = new Thing();
static final Set allThings = // ?????
}
How should I do this?