code: public static int priorityOf(Class<?> someClass) {
          while (someClass != null) {
              Priority annotation = someClass.getAnnotation(Priority.class);
              if (annotation != null) {
                  return annotation.value();
              }
              someClass = someClass.getSuperclass();
          }
          return 0;
      }
docs: Retrieves the priority of a class by using the value of the {@link Priority} annotation
  present on the class or on
  its superclasses. If no annotation is found, the returned priority is 0.
  
  @param someClass the class to extract priority from.
  @return the priority.