code: public static String getTemplateName(final Viewable viewable) {
          return viewable.getTemplateName() == null || viewable.getTemplateName().isEmpty() ? "index" : viewable.getTemplateName();
      }
docs: Get template name from given {@link org.glassfish.jersey.server.mvc.Viewable viewable} or return {@code index} if the given
  viewable doesn't contain a valid template name.
  
  @param viewable viewable to obtain template name from.
  @return {@code non-null}, {@code non-empty} template name.