private static @Nullable Renderer<Object> getRenderer(Class<?> clazz) {
    if (clazz == null) return null;

    @SuppressWarnings("unchecked")
    Renderer<Object> renderer = (Renderer<Object>)RENDERERS.get(clazz);
    if (renderer != null) return renderer;

    Class<?>[] interfaces = clazz.getInterfaces();
    for (Class<?> aClass : interfaces) {
      renderer = getRenderer(aClass);
      if (renderer != null) {
        return renderer;
      }
    }
    clazz = clazz.getSuperclass();
    if (clazz != null) {
      return getRenderer(clazz);
    }
    return null;
  }
private static @Nullable Renderer<Object> getRenderer(Class<?> clazz)