code: public static Object getValueFromMapForClass(final Class typeClass, final Map classMap) {
  		Object val = classMap.get(typeClass);
  		if (val == null) {
  			// search through the interfaces first
  			val = getValueFromMapForInterfaces(typeClass, classMap);
  
  			if (val == null) {
  				// now go up through the inheritance hierarchy
  				val = getValueFromMapForSuperClass(typeClass, classMap);
  			}
  
  			if (val == null) {
  				// not found anywhere
  				if (logger.isDebugEnabled()) {
  					logger.debug("Could not find a definition for " + typeClass + " in " + classMap.keySet());
  				}
  				return null;
  			}
  
  			// remember this so it doesn't have to be looked-up again
  			classMap.put(typeClass, val);
  			return val;
  		}
  		return val;
  	}
docs: Given a {@link Map}where the keys are {@link Class}es, search the map
  for the closest match of the key to the <tt>typeClass</tt>. This is
  extremely useful to support polymorphism (and an absolute requirement to
  find proxied classes where classes are acting as keys in a map).
  <p />
  
  For example: If the Map has keys of Number.class and String.class, using
  a <tt>typeClass</tt> of Long.class will find the Number.class entry and
  return its value.
  <p />
  
  When doing the search, it looks for the most exact match it can, giving
  preference to interfaces over class inheritance. As a performance
  optimiziation, if it finds a match it stores the derived match in the map
  so it does not have to be derived again.
  
  @param typeClass the kind of class to search for
  @param classMap the map where the keys are of type Class
  @return null only if it can't find any match