private static <T> T borrow(ConcurrentMap<Class<T>, NavigableSet<T>> pool,
    Class<? extends T> codecClass) {
    if (codecClass == null) {
      return null;
    }

    NavigableSet<T> codecSet = pool.get(codecClass);
    if (codecSet != null) {
      // If a copy of the codec is available, pollFirst() will grab one.
      // If not, it will return null.
      return codecSet.pollFirst();
    } else {
      return null;
    }
  }
Call if you want lease counting to be enabled. Only used in unit tests.
hbase-common/src/main/java/org/apache/hadoop/hbase/io/compress/CodecPool.java