liquibase-core/src/main/java/liquibase/plugin/AbstractPluginFactory.java
protected T getPlugin(final Object... args) {
        TreeSet<T> applicable = new TreeSet<>((o1, o2) -> {
            Integer o1Priority = getPriority(o1, args);
            Integer o2Priority = getPriority(o2, args);

            int i = o2Priority.compareTo(o1Priority);
            if (i == 0) {
                return o1.getClass().getName().compareTo(o2.getClass().getName());
            }
            return i;
        });

        for (T plugin : findAllInstances()) {
            if (getPriority(plugin, args) >= 0) {
                applicable.add(plugin);
            }
        }

        if (applicable.size() == 0) {
            return null;
        }

        return applicable.iterator().next();

    }
protected T getPlugin(final Object... args) {
        TreeSet<T> applicable = new TreeSet<>((o1, o2) -> {
            Integer o1Priority = getPriority(o1, args);
            Integer o2Priority = getPriority(o2, args);

            int i = o2Priority.compareTo(o1Priority);
            if (i == 0) {
                return o1.getClass().getName().compareTo(o2.getClass().getName());
            }
            return i;
        });

        for (T plugin : findAllInstances()) {
            if (getPriority(plugin, args) >= 0) {
                applicable.add(plugin);
            }
        }

        if (applicable.size() == 0) {
            return null;
        }

        return applicable.iterator().next();

    }
Finds the plugin for which {@link #getPriority(Plugin, Object...)}  returns the highest value for the given scope and args.
This method is called by a public implementation-specific methods.
Normally this does not need to be overridden, instead override {@link #getPriority(Plugin, Object...)} to compute the priority of each object for the scope and arguments passed to this method.

@return null if no plugins are found or have a priority greater than zero.