public long getReferenceCount(E key) {
    ReferenceCounter counter = referenceMap.get(key);
    if (counter != null) {
      return counter.getRefCount();
    }
    return 0;
  }
@Test
  public void testRefCountMapConcurrently() throws Exception {
    ReferenceCountMap<AclFeature> countMap = new ReferenceCountMap<>();

    PutThread putThread1 = new PutThread(countMap);
    putThread1.start();
    PutThread putThread2 = new PutThread(countMap);
    putThread2.start();
    RemoveThread removeThread1 = new RemoveThread(countMap);

    putThread1.join();
    putThread2.join();
    Assert.assertEquals(2 * LOOP_COUNTER,
        countMap.getReferenceCount(aclFeature1));
    Assert.assertEquals(2 * LOOP_COUNTER,
        countMap.getReferenceCount(aclFeature2));

    removeThread1.start();
    removeThread1.join();
    Assert.assertEquals(LOOP_COUNTER, countMap.getReferenceCount(aclFeature1));
    Assert.assertEquals(LOOP_COUNTER, countMap.getReferenceCount(aclFeature2));
  }