code: public Method getInvokableMethodForClass(final Class<?> valueClass) {
          if (valueClass == null)
              return null;
  
          Method method = methods.get(valueClass);
          if (method != null)
              return method;
  
          // get the list of all classes and interfaces.
          // first classes.
          Class<?> clazz = valueClass.getSuperclass();
          while (clazz != null) {
              method = methods.get(clazz);
              if (method != null) {
                  methods.put(valueClass, method);
                  return method;
              }
              clazz = clazz.getSuperclass();
          }
  
          // now look through the interfaces.
          for (final Class<?> iface : valueClass.getInterfaces()) {
              method = methods.get(iface);
              if (method != null) {
                  methods.put(valueClass, method);
                  return method;
              }
          }
  
          return null;
      }
docs: ----------------------------------------------------------------------------