What's wrong with using Comparator from Scala? The invocation is not compiled:
java.util.Comparator.comparing(
new java.util.function.Function[String, java.math.BigInteger] {
override def apply(t: String) = new java.math.BigInteger(t)
})
The error message is very unclear.
Main.scala:3: error: overloaded method value comparing with alternatives:
[T, U <: Comparable[_ >: U]](x$1: java.util.function.Function[_ >: T, _ <: U])java.util.Comparator[T] <and>
[T, U](x$1: java.util.function.Function[_ >: T, _ <: U], x$2: java.util.Comparator[_ >: U])java.util.Comparator[T]
cannot be applied to (java.util.function.Function[String,java.math.BigInteger])
java.util.Comparator.comparing(
^
What's wrong with that?