code: private RendererSelection isRendererMatch(RendererBeanDescriptor<?> rendererDescriptor, Renderable renderable,
              RendererSelection bestMatch) {
          final Class<? extends Renderable> renderableType = rendererDescriptor.getRenderableType();
          if (ReflectionUtils.is(renderable.getClass(), renderableType)) {
              if (bestMatch == null) {
                  return isRendererCapable(rendererDescriptor, renderable, bestMatch);
              } else {
                  int hierarchyDistance = ReflectionUtils.getHierarchyDistance(renderable.getClass(), renderableType);
  
                  if (hierarchyDistance == 0) {
                      // no hierarchy distance
                      return isRendererCapable(rendererDescriptor, renderable, bestMatch);
                  }
  
                  if (hierarchyDistance <= bestMatch.getHierarchyDistance()) {
                      // lower hierarchy distance than best match
                      return isRendererCapable(rendererDescriptor, renderable, bestMatch);
                  }
              }
          }
          return null;
      }
docs: Checks if a particular renderer (descriptor) is a good match for a
  particular renderer.
  
  @param rendererDescriptor
  the renderer (descriptor) to check.
  @param renderable
  the renderable that needs rendering.
  @param bestMatchingDescriptor
  the currently "best matching" renderer (descriptor), or null
  if no other renderers matches yet.
  @return a {@link RendererSelection} object if the renderer is a match, or
  null if not.