code: private List<ModelProcessorUtil.Method> getEnhancingMethods(final RuntimeResource runtimeResource) {
          final List<ModelProcessorUtil.Method> newMethods = Lists.newArrayList();
  
          for (final Resource resource : runtimeResource.getResources()) {
              // Handler classes.
              for (final Class<?> handlerClass : resource.getHandlerClasses()) {
                  createEnhancingMethods(handlerClass, null, newMethods);
              }
  
              // Names - if there are no handler classes / instances.
              if (resource.getHandlerClasses().isEmpty() && resource.getHandlerInstances().isEmpty()) {
                  for (String resourceName : resource.getNames()) {
                      final Class<Object> resourceClass = AccessController
                              .doPrivileged(ReflectionHelper.classForNamePA(resourceName));
                      if (resourceClass != null) {
                          createEnhancingMethods(resourceClass, null, newMethods);
                      }
                  }
              }
  
              // Handler instances.
              Errors.process((Producer<Void>) () -> {
                  for (final Object handlerInstance : resource.getHandlerInstances()) {
                      final Class<?> handlerInstanceClass = handlerInstance.getClass();
  
                      if (!resource.getHandlerClasses().contains(handlerInstanceClass)) {
                          createEnhancingMethods(handlerInstanceClass, handlerInstance, newMethods);
                      } else {
                          Errors.warning(resource,
                                  LocalizationMessages.TEMPLATE_HANDLER_ALREADY_ENHANCED(handlerInstanceClass));
                      }
                  }
  
                  return null;
              });
          }
  
          return newMethods;
      }
docs: Returns a list of enhancing methods for a given {@link org.glassfish.jersey.server.model.RuntimeResource runtime resource}.
  
  @param runtimeResource runtime resource to create enhancing methods for.
  @return list of enhancing methods.