On Wed, 25 Nov 2020 16:26:12 GMT, Rémi Forax <github.com+828220+fo...@openjdk.org> wrote:
>> Not sure that >> `.sorted(Comparator.comparingInt(RandomGeneratorFactory<RandomGenerator>::stateBits).reversed())` >> is simpler than `.sorted((f, g) -> Integer.compare(g.stateBits(), >> f.stateBits()))`. > > At least, it's more clear that it's reversed, i've initially miss the fact > that f and g are swapped. > And :: is able to do inference so, i believe it can be written > > `.sorted(Comparator.comparingInt(RandomGeneratorFactory::stateBits).reversed())` Unfortunately it couldn't be inferred ------------- PR: https://git.openjdk.java.net/jdk/pull/1292