code: private ResolvedViewable resolve(final Viewable viewable) {
          if (viewable instanceof ResolvedViewable) {
              return (ResolvedViewable) viewable;
          } else {
              final ViewableContext viewableContext = getViewableContext();
              final Set<TemplateProcessor> templateProcessors = getTemplateProcessors();
  
              List<MediaType> producibleMediaTypes = TemplateHelper
                      .getProducibleMediaTypes(requestProvider.get(), extendedUriInfoProvider.get(), null);
  
              if (viewable instanceof ImplicitViewable) {
                  // Template Names.
                  final ImplicitViewable implicitViewable = (ImplicitViewable) viewable;
  
                  for (final String templateName : implicitViewable.getTemplateNames()) {
                      final Viewable simpleViewable = new Viewable(templateName, viewable.getModel());
  
                      final ResolvedViewable resolvedViewable = resolve(simpleViewable, producibleMediaTypes,
                              implicitViewable.getResolvingClass(), viewableContext, templateProcessors);
  
                      if (resolvedViewable != null) {
                          return resolvedViewable;
                      }
                  }
              } else {
                  final Class<?> resourceClass = resourceInfoProvider.get().getResourceClass();
                  return resolve(viewable, producibleMediaTypes, resourceClass, viewableContext, templateProcessors);
              }
  
              return null;
          }
      }
docs: Resolve the given {@link org.glassfish.jersey.server.mvc.Viewable viewable} using
  {@link org.glassfish.jersey.server.mvc.spi.ViewableContext}.
  
  @param viewable viewable to be resolved.
  @return resolved viewable or {@code null}, if the viewable cannot be resolved.