@SuppressWarnings("unchecked") public synchronized T findCounter(Enum<?> counterKey) throws IllegalAccessException, InstantiationException {
  T counter=cache.get(counterKey);
  if (counter == null) {
    counter=counterType.newInstance();
    cache.put(counterKey,counter);
  }
  return counter;
}

@ SuppressWarnings ( "unchecked" ) public synchronized T findCounter ( Enum < ? > counterKey ) throws IllegalAccessException , InstantiationException { T counter = cache . get ( counterKey ) ; if ( counter == null ) { counter = counterType . newInstance ( ) ; cache . put ( counterKey , counter ) ; } return counter ; }
returns the counter associated with the key . creates it if it doesn ' t exist .
