class HealthCheckComparatorSupport {

    public static Comparator<Object> getComparatorToUse(BeanFactory beanFactory) {
        Comparator<Object> comparatorToUse = null;
        if (beanFactory instanceof DefaultListableBeanFactory) {
            comparatorToUse = ((DefaultListableBeanFactory) beanFactory).getDependencyComparator();
        }
        if (beanFactory != null) {
            ObjectProvider<HealthCheckerComparatorProvider> objectProvider = beanFactory
                .getBeanProvider(HealthCheckerComparatorProvider.class);
            HealthCheckerComparatorProvider healthCheckerComparatorProvider = objectProvider
                .getIfUnique();
            if (healthCheckerComparatorProvider != null) {
                comparatorToUse = healthCheckerComparatorProvider.getComparator();
            }
        }
        if (comparatorToUse == null) {
            comparatorToUse = AnnotationAwareOrderComparator.INSTANCE;
        }
        return comparatorToUse;
    }

    public static <T, U> LinkedHashMap<T, U> sortMapAccordingToValue(Map<T, U> origin, Comparator<Object> comparatorToUse) {<FILL_FUNCTION_BODY>}
}

        List<Map.Entry<T, U>> entryList = new ArrayList<>(origin.entrySet());
        entryList.sort((o1, o2) -> comparatorToUse.compare(o1.getValue(), o2.getValue()));

        LinkedHashMap<T, U> result = new LinkedHashMap<>();
        for (Map.Entry<T, U> entry : entryList) {
            result.put(entry.getKey(), entry.getValue());
        }
        return result;
    
<no_super_class>