@Override
    public ResourceReference refer(Object context) {
        synchronized (contextMap) {
            if (contextMap.isEmpty()) {
                throw new IllegalStateException("Object is already destroyed, no more new references may be created."
                        + " State={ " + currentState() + " }");
            }
            Long key = contextId++;
            contextMap.put(key, context != null ? context : key);
            return new Reference(this, key);
        }
    }
Does reference counting by putting a unique key together with optional context in map
Used if system property jdisc.debug.resources=simple/true

@author baldersheim
jdisc_core/src/main/java/com/yahoo/jdisc/refcount/DebugReferencesByContextMap.java