public static @NotNull <Type, Aspect> Comparator<Type> compareBy(final @NotNull Function<? super Type, ? extends Aspect> aspect, final @NotNull Comparator<? super Aspect> comparator) {
    return (element1, element2) -> comparator.compare(aspect.apply(element1), aspect.apply(element2));
  }
public static @NotNull <Type, Aspect> Comparator<Type> compareBy(final @NotNull Function<? super Type, ? extends Aspect> aspect, final @NotNull Comparator<? super Aspect> comparator)