private @Nullable PresentationTemplate createPresentationTemplate(Class<?> type) {
    Presentation presentation = type.getAnnotation(Presentation.class);
    if (presentation != null) {
      return new AnnotationBasedTemplate(presentation, type);
    }

    PresentationProvider<?> provider = PROVIDERS.forClass(type);
    if (provider != null) {
      return new ProviderBasedTemplate(provider);
    }

    NullableLazyValue<Icon> icon = myIcons.get(type.getName());
    NullableLazyValue<String> typeName = myNames.get(type.getName());
    if (icon == null && typeName == null) {
      return null;
    }

    return new PresentationTemplate() {
      @Override
      public @Nullable Icon getIcon(Object o, int flags) {
        return icon == null ? null : icon.getValue();
      }

      @Override
      public @Nullable String getName(Object o) {
        return null;
      }

      @Override
      public @Nullable String getTypeName() {
        return typeName == null ? null : typeName.getValue();
      }

      @Override
      public @Nullable String getTypeName(Object o) {
        return getTypeName();
      }
    };
  }
private @Nullable PresentationTemplate createPresentationTemplate(Class<?> type)