private Object lookupCache(ArrayList cache, int index) {
        if (index < cache.size()) {
            Object result = cache.get(index);
            if (result == UNDER_CONSTRUCTION)
                throw new RuntimeException("Unable to resolve circular reference in cache");
            else
                return result;
        } else {
            throw new RuntimeException("Requested object beyond end of cache at " + index);
        }
    }