code: private TableCellRenderer installRendererIfPossible(Class objectClass, TableCellRenderer renderer) {
          TableCellRenderer currentRenderer = table.getDefaultRenderer(objectClass);
  
          if (currentRenderer instanceof UIResource) {
              table.setDefaultRenderer(objectClass, renderer);
          }
  
          return currentRenderer;
      }
docs: Installs a renderer if the existing renderer is an instance of
  UIResource.
  
  @param  objectClass the class for which to install the renderer.
  @param  renderer    the renderer instance.
  
  @return the previous renderer.