If you have priorities based on enums, this is the recommended prioritizer to use as it will prevent
starvation of low priority items

@param groupClass
@return
179097
public ExecutorLoadBalancingConfig<GROUP> useLoadBalancedEnumOrdinalPrioritizer(Class<GROUP> groupClass) {
        if(!groupClass.isEnum()) {
            throw new IllegalArgumentException("The group class "+groupClass+" is not an enum");
        }
        groupPrioritizer = new LoadBalancedPriorityPrioritizer<GROUP>(new EnumOrdinalPrioritizer<GROUP>());
        return this;
    }
291168
public B group(EventLoopGroup group) {
        if (group == null) {
            throw new NullPointerException("group");
        }
        if (this.group != null) {
            throw new IllegalStateException("group set already");
        }
        this.group = group;
        return self();
    }
1192074
private int adjustPriority(int priority) {

        try {
            Subtypes2 subtypes2 = AnalysisContext.currentAnalysisContext().getSubtypes2();

            if (!subtypes2.hasSubtypes(getClassDescriptor())) {
                priority++;
            } else {
                Set<ClassDescriptor> mySubtypes = subtypes2.getSubtypes(getClassDescriptor());

                String myPackagename = getThisClass().getPackageName();

                for (ClassDescriptor c : mySubtypes) {
                    if (c.equals(getClassDescriptor())) {
                        continue;
                    }
                    if (!c.getPackageName().equals(myPackagename)) {
                        priority--;
                        break;
                    }
                }
            }
        } catch (ClassNotFoundException e) {
            bugReporter.reportMissingClass(e);
        }
        return priority;
    }
806587
public ThreadFactoryBuilder setPriority(int priority) {
		if (priority < Thread.MIN_PRIORITY) {
			throw new IllegalArgumentException(StrUtil.format("Thread priority ({}) must be >= {}", priority, Thread.MIN_PRIORITY));
		}
		if (priority > Thread.MAX_PRIORITY) {
			throw new IllegalArgumentException(StrUtil.format("Thread priority ({}) must be <= {}", priority, Thread.MAX_PRIORITY));
		}
		this.priority = priority;
		return this;
	}
1203368
@Override
	public List<CPDefinitionSpecificationOptionValue> findByGroupId(
		long groupId) {
		return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
281197
public static <E extends Enum<E>> EnumJsonDeserializer<E> newInstance( Class<E> enumClass ) {
        return new EnumJsonDeserializer<E>( enumClass );
    }
1212585
public static AbstractWarningsParser getParser(@CheckForNull final String group) {
        if (StringUtils.isEmpty(group)) {
            return new NullWarnigsParser("NULL");
        }

        List<AbstractWarningsParser> parsers = ParserRegistry.getParsers(group);
        if (parsers.isEmpty()) {
            return new NullWarnigsParser(group);
        }
        else {
            return parsers.get(0);
        }
    }
941590
public static <K extends Enum<K> & MultiKeyed> EnumLookup<K, String> of(
    		final Class<K> enumClass, final int idx, final boolean caseSensitive) {
        return new EnumLookup<K, String>(enumClass, idx, caseSensitive);
    }
18033
@SafeVarargs
    public final OptionsConfig hideGroups(final Class<Enum>... groups) {
        hiddenGroups.addAll(Arrays.asList(groups));
        return this;
    }
81225
@Override
    public IEntityGroup newGroup(Class type) throws GroupsException {
        throwExceptionIfNotInternallyManaged();
        IEntityGroup group = groupFactory.newInstance(type);
        group.setLocalGroupService(this);
        if (cacheInUse()) {
            cacheAdd(group);
        }
        return group;
    }
1189642
public GroupChain getGroupChainFor(final Collection<Class<?>> groups) {
    if (groups == null || groups.isEmpty()) {
      throw new IllegalArgumentException("At least one group has to be specified.");
    }

    groups.forEach(clazz -> {
      if (!validationGroupsMetadata.containsGroup(clazz)
          && !validationGroupsMetadata.isSeqeuence(clazz)) {
        throw new ValidationException("The class " + clazz + " is not a valid group or sequence.");
      }
    });

    final GroupChain chain = new GroupChain();
    groups.forEach(clazz -> {
      if (isGroupSequence(clazz)) {
        insertSequence(clazz, chain);
      } else {
        final Group group = new Group(clazz);
        chain.insertGroup(group);
        insertInheritedGroups(clazz, chain);
      }
    });

    return chain;
  }
306092
@Override
    public java.util.Iterator findMemberGroups(IEntityGroup group) throws GroupsException {
        String[] keys = findMemberGroupKeys(group); // No foreign groups here.
        List groups = new ArrayList(keys.length);
        for (int i = 0; i < keys.length; i++) {
            groups.add(find(keys[i]));
        }
        return groups.iterator();
    }
1020597
public static String enumValues(Class<?> enumClass) {
    Preconditions.checkNotNull(enumClass, "enumClass cannot be null");
    Preconditions.checkState(enumClass.isEnum(), "enumClass must be an enum.");
    return Joiner.on(", ").join(enumClass.getEnumConstants());
  }
751202
public <T extends Enum<T>> EnumSet<T> getParametersAsEnums(String name, Class<T> type, EnumSet<T> defaultValue) {
		String[] enumNames = getParameters(name);
		if (enumNames == null) {
			return defaultValue;
		} else {
			Collection<T> enums = new ArrayList<>();
			for (String enumName : enumNames) {
				T enumValue = stringToEnum(blankToNull(enumName), type);
				if (enumValue != null) {
					enums.add(enumValue);
				}
			}
			return enums.isEmpty() ? defaultValue : EnumSet.copyOf(enums);
		}
	}
346398
public <E extends T> OnItemBindClass<T> map(@NonNull Class<E> itemClass, @NonNull OnItemBind<E> onItemBind) {
        int index = itemBindingClassList.indexOf(itemClass);
        if (index >= 0) {
            itemBindingList.set(index, onItemBind);
        } else {
            itemBindingClassList.add(itemClass);
            itemBindingList.add(onItemBind);
        }
        return this;
    }
964598
public Set<Class<?>> getAllGroupsAndSequences() {
    final Set<Class<?>> allGroups = new HashSet<>();
    for (final Map.Entry<Class<?>, Set<Class<?>>> entry : inheritanceMapping.entrySet()) {
      allGroups.add(entry.getKey());
      allGroups.addAll(entry.getValue());
    }
    allGroups.addAll(sequenceMapping.keySet());
    return allGroups;
  }
157969
public static Set<Class<?>> commonSuperclasses(Iterable<Class<?>> classes) {
        Iterator<Class<?>> it = classes.iterator();
        if (!it.hasNext()) {
            return Collections.emptySet();
        }
        // begin with set from first hierarchy
        Set<Class<?>> result = getSuperclasses(it.next());
        // remove non-superclasses of remaining
        while (it.hasNext()) {
            Class<?> c = it.next();
            Iterator<Class<?>> resultIt = result.iterator();
            while (resultIt.hasNext()) {
                Class<?> sup = resultIt.next();
                if (!sup.isAssignableFrom(c)) {
                    resultIt.remove();
                }
            }
        }
        return result;
    }