static <T extends TypeT> T[] indexed(Class<T> cls) {        
        ArrayList<T> found = new ArrayList<>();
        for (Field f: cls.getDeclaredFields()) {
            if (cls.isAssignableFrom(f.getType())) {
                try {
                    T type = (T)f.get(null);
                    found.add(type);                    
                } catch (IllegalAccessException err) {
                    //err.printStackTrace();
                }                
            }
        }
        int size = found.size();
        if (size == 0) {
            throw new RuntimeException(cls + " is empty");
        }  
        T[] types = (T[])Array.newInstance(cls, size);        
        for (T x: found) {
            if (x.index < 0 || x.index >= size) {
                throw new IllegalArgumentException(cls + " Bad Index: " + x.index);
            }
            if (types[x.index] != null) {
                throw new IllegalArgumentException(cls + " Index Collision: " + x.index);
            }
            types[x.index] = x;
        }
        return types;
    }