private void removeRef(Long key) {
        synchronized (contextMap) {
            contextMap.remove(key);
            if (contextMap.isEmpty()) {
                resource.close();
            }
        }
    }
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