private static <T> ServiceNode addService(Object service,
                                            List<ServiceViewItem> children,
                                            Project project,
                                            ServiceViewItem parent,
                                            ServiceViewContributor<T> contributor) {
    //noinspection unchecked
    T typedService = (T)service;
    Object value =
      service instanceof ServiceViewProvidingContributor ? ((ServiceViewProvidingContributor<?, ?>)service).asService() : service;
    if (contributor instanceof ServiceViewGroupingContributor) {
      ServiceNode serviceNode =
        addGroupNode((ServiceViewGroupingContributor<T, ?>)contributor, typedService, value, parent, project, children);
      if (serviceNode != null) {
        return serviceNode;
      }
    }

    ServiceNode
      serviceNode = new ServiceNode(value, parent, contributor, contributor.getServiceDescriptor(project, typedService), project,
                                    service instanceof ServiceViewContributor ? (ServiceViewContributor<?>)service : null);
    addServiceOrdered(children, serviceNode, contributor);
    return serviceNode;
  }
private static <T> ServiceNode addService(Object service,
                                            List<ServiceViewItem> children,
                                            Project project,
                                            ServiceViewItem parent,
                                            ServiceViewContributor<T> contributor)